The value of the variable a contains the value [1, 2, 3, 4, 5], which is divided by adding the value from the previous to the third. I would like to display the so-called average value (b), but it doesn't work.
if__name__=="_main__":
a = [1, 2, 3, 4, 5]
for i in range (len(a)) :
a.append(a[i]+a[i]/3)
x = a.range(0,len(dates[0]))
print(b)
How about this?
if__name__=="_main__":
a = [1, 2, 3, 4, 5]
target=a[:3]#=>[1,2,3]
s=sum(target)
l=len(target)
b=s/l
print(b)
© 2024 OneMinuteCode. All rights reserved.