pthon 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
nums = ['one', 'two', 'three']
for elem in nums:
print(elem)