Your MATLAB code does not create the plot you showed. This is because t is not a range, but a vector of the 3 values 0, 0.01 and 0.098, so instead, it plots only those 3 points:

Fixing your MATLAB code
To create the plot you showed in MATLAB, you can do this:
t=[0:0.01:0.98];
y2=cos(8*pi*t);
plot(t,y2);
Notice the use of the : instead of the ,, to specify that you want a range of values from 0 to 0.98 with a step of 0.01, rather than the vector of the three values 0, 0.01 and 0.98.
Recreating the plot in python:
use np.arange, as well as the cos and pi functions provided by numpy
import numpy as np
import matplotlib.pyplot as plt
t = np.arange(0,0.99,0.01)
y = np.cos(8*np.pi*t)
plt.plot(t, y)
plt.show()

numpy:import numpy as npfollowed byt=np.arange(0,0.98,0.01)np.arange(0, 0.99, 0.01)