python how to loop code example
Example 1: pytho loops
for x in loop:
print(x)
Example 2: for loop python
Python Loops
for x in range(1, 80, 2):
print(x)
words=['zero','one','two']
for operator, word in enumerate(words):
print(word, operator)
for x in range(1, 80, 2):
print(x)
Example 3: python for loop
for i in range(5):
print(i) #0, 1, 2, 3, 4
for i in range(2, 8):
print(i) #2, 3, 4, 5, 6, 7, 8
for i in range(2, 10, 2):
print(i) #2, 4, 6, 8, 10
for i in (['a', 'b', 'c']):
print(i) #a, b, c
Example 4: python loop
for i in range(1, 10);
print(i)