For Loop and Range in Python by CodingXpertz

Publicado em: 18 Fevereiro 2023
no canal de: Coding Xpertz
23
0

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.


Nesta página do site você pode assistir ao vídeo on-line For Loop and Range in Python by CodingXpertz duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário Coding Xpertz 18 Fevereiro 2023, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 23 vezes e gostou 0 espectadores. Boa visualização!