writing for loops code example
Example 1: for loop
for(int i = 0; i < some_number; i++){
//inside loop do whatever you want
}
Example 2: python for loop
for i in range(5, 9):
print(i)
Example 3: for loops
MyString = ""
for i in range(5):
MyString += "hi"
print(MyString)
Example 4: for loop
fruits = ['apple', 'orange', 'peach']
for fruit in fruits:
print(fruit)