Как зацикнуть длину массива pytoh
array = range(10)
for i in range(len(array)):
print(array[i])
Expensive Eagle
array = range(10)
for i in range(len(array)):
print(array[i])
foo = ['foo', 'bar']
for i in foo:
print(i) #outputs 'foo' then 'bar'
for i in range(len(foo)):
print(foo[i]) #outputs 'foo' then 'bar'
i = 0
while i < len(foo):
print(foo[i]) #outputs 'foo' then 'bar'
array = ["Var1","Var2","Var3"]
for i in range(len(array)):
print(array[i])
#Output#
#Var1
#Var2
#Var3