bucle python
#x starts at 1 and goes up to 80 @ intervals of 2
for x in range(1, 80, 2):
print(x)
python pentru buclă
for x in (list):
print(x)
python pentru buclă
words=['zero','one','two']
for operator, word in enumerate(words):
print(word, operator)
for _ in range(1,10,2): #(initial,final but not included, gap) (the "_" underscore symbol mean there are no variables initialize in this loop)
print("hi");
pentru buclă în python
#Python syntax for loop
add=0
for i in range(0,10):
add=add+i
add=0
list_1=[1,2,3,4,5,6,7]
for i in list_1:
add=add+i