Loops
No account is required. Learn the material, try the examples, and mark it complete locally when you are ready to move on.
For loop
Now we are ready to learn a simple for loop.
Lets imagine if our object was to print a same thing 5 times. We would have to in this case write print function 5 times, right?
4 in range(5)Truefor i in range(5):
print("Hello. THe value of i is: {}".format(i))Hello. THe value of i is: 0
Hello. THe value of i is: 1
Hello. THe value of i is: 2
Hello. THe value of i is: 3
Hello. THe value of i is: 4