paython for loop code example
Example 1: python for loop
#an object to iterate over
items = ["Item1", "Item2", "Item3", "Item4"]
#for loop using range
for i in range(len(items)):
print(items[i])
#for loop w/o using range
for item in items:
print(item)
Example 2: python for loop
words=['zero','one','two']
for operator, word in enumerate(words):
print(word, operator)