loop for loop code example
Example 1: for loops
MyString = ""
for i in range(5):
MyString += "hi"
print(MyString)
Example 2: for loop
fruits = ['apple', 'orange', 'peach']
for fruit in fruits:
print(fruit)
MyString = ""
for i in range(5):
MyString += "hi"
print(MyString)
fruits = ['apple', 'orange', 'peach']
for fruit in fruits:
print(fruit)