Vous utilisez un navigateur non à jour ou ancien. Il ne peut pas afficher ce site ou d'autres sites correctement. Vous devez le mettre à jour ou utiliser un navigateur alternatif.
C'est normal, il faut intenter le contenue de ta fonction comme ceci :
Code:
def test():
print("test")
Et non comme ça :
def test():
print("test")
c'est comme si ta fonction ne contenais rien.
Code correct :
Code:
def moving_average (tab, N) :
S = 0
R = T
for i in range (N,len(T)) :
S == 0
for k in range (i-N+1,i):
S == S+T[k]
R[i] == S/N
for i in range (1,N-1):
R[i] == T[i]
return R[i]
y = []
for x in range(1000):
y += [math.cos(x/100 + random.random())]
graphic.plot(y)
graphic.plot(moving_average(y,10))
graphic.show()