py for loop code example
Example 1: python loops
for x in range(1, 80, 2):
print(x)
Example 2: python for loop
for x in (list):
print(x)
Example 3: how to use for loops python
for i in range(1,100):
print(i)
fruits = ["apple","peach","banana"]
for fruit in fruits:
print(fruit)
Example 4: how to make loop python
loop = True
while loop:
print('Loop Worked')
Example 5: python for loop
for i in range(3):
print(i)
Example 6: python for loop
for x in range(5):
print(x)
letters = ['a', 'b', 'c']
for letter in letters:
print(letter)
letters = {'a': 1, 'b': 2, 'c': 3}
for letter, num in letters.items():
print(letter, num)