1#x starts at 1 and goes up to 80 @ intervals of 2
2for x in range(1, 80, 2):
3 print(x)
1Python Loops
2
3for x in range(1, 80, 2):
4 print(x)
5
6words=['zero','one','two']
7for operator, word in enumerate(words):
8 print(word, operator)
9
10for x in range(1, 80, 2):
11 print(x)
12
13
14
15
16
1# how to use for in python for (range, lists)
2fruits = ["pineapple","apple", "banana", "cherry"]
3for x in fruits:
4 if x == "apple":
5 continue
6 if x == "banana":
7 break
8 print(x)
9# fron 2 to 30 by 3 step
10for x in range(2, 30, 3):
11 print(x)