For Loop:
You can tackle the for loop in the same way as the while loop. As you probably would have expected, the "for" component in "for loop" refers to something that you do for a certain number of times.
If you keep all the above in mind, you can easily define the for loop as follows:
A for loop is a programming concept that, when it's implemented, executes a piece of code over and over again "for" a certain number of times, based on a sequence.
In contrast to the while loop, there isn't any condition actively involved - you just execute a piece of code repeatedly for a number of times. In other words, while the while loop keeps on executing the block of code contained within it only till the condition is True, the for loop executes the code contained within it only for a specific number of times. This "number of times" is determined by a sequence or an ordered list of things.
You'll learn more about the difference between while and for loops in a bit, but for now, concentrate on the following pieces that you need in order to create a for loop:
The for keyword
A variable
The in keyword
The range() function, which is an built-in function in the Python library to create a sequence of numbers
The code that you want to execute repeatedly
En esta página del sitio puede ver el video en línea Python for loops tutorial in less than 7 minutes de Duración hora minuto segunda en buena calidad , que subió el usuario Python Soldiers 25 octubre 2021, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 46 veces y le gustó 3 a los espectadores. Disfruta viendo!