for and in python code example
Example 1: python for in for in
adj = ["red", "big"]
fruits = ["apple", "banana"]
for x in adj:
for y in fruits:
print(x, y)
#output: red apple, red banana, big apple, big banana
Example 2: python for loop
my_list = ["milk", "coffee", "bread"]
# i stands for iterator
for i in my_list:
print(i) # prints every element of my_list