pyton 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: python for loop
a = 10
for i in range(1, 10)
print(i)
Example 4: loop in python
print("INCREMENTED FOR LOOP")
for i in range(0, 5):
print(i)
print("\n DECREMENTED FOR LOOP")
for i in range(4, -1, -1):
print(i)
Example 5: 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)