0
Repeating loops
Can someone show me how to make a loop that goes about 50 times please? Thanks
3 odpowiedzi
+ 1
for i in range(50):
print(i)
OR
run=0
while run <50:
print(run)
run=run+1
+ 1
This code prints a list of numbers 0-49
run=0
while run <50:
print(run)
run+=1
(Note: 50 is not included if you need change >=50 in code)
This code prints out "run" 50 times
run=0
while run <50:
print("run")
run+=1
Highlight: run = run +1 <===> run+=1
+ 1
thanks for the help guys!! Its really helpful. ^-^