Another thing every programming language must do is to provide a way to perform the same
action multiple times. The keyword for is one one way in which you can loop through code
while executing repeatedly.
For as long as you have more hamburger to eat, keep eating that hamburger.
For loops come in many forms.
You can loop through a list of values. That list is surrounded with square brackets. Each time
through the list the next value will be assigned to the variable I in this example.
CODE
for i in [2,4,6,8,10]:
print("i = ", i)
We can also have the keyword range define our list for us. range(10) will create a list starting at
0 and go up to, but not include 10, the number passed into it.
We can now combine range with a for loop to print the numbers 0 through 4 like so.
On this page of the site you can watch the video online For Loop and Range in Python by CodingXpertz with a duration of hours minute second in good quality, which was uploaded by the user Coding Xpertz 18 February 2023, share the link with friends and acquaintances, this video has already been watched 23 times on youtube and it was liked by 0 viewers. Enjoy your viewing!