xxxxxxxxxx
#the number is how many times you want to loop
for i in range (number):
#here where you put your looping code
#for example
for i in range (4):
print(Hello World)
print(Hi World)
#output
Hello World
Hi World
Hello World
Hi World
Hello World
Hi World
Hello World
Hi World
#check out more:https://www.askpython.com
xxxxxxxxxx
#This is how a python loop could look like
x = 1000 # Any number could work here
while not(x == 0):
print(x)
x = x - 1
if(x == 0):
print("Finished")
xxxxxxxxxx
for i in [1,3,5,54,5683]:
print(i+1)
#This is a simple program which prints the
#successor of all numbers in the list.
#Loops are amazing! Here, 'i' is an
#iteration variable which means it changes
#with every next step on to the loop!
#so i is 1 at one point and 3 in the next!
#You can learn more @ https://python.org
#:)
xxxxxxxxxx
for i in range(amount of times in intager form):
#do stuff
print(i)# you could use i as a variable. You could set it as u, ool, or anything you want. No blancs tho.
# i will be the amount of times the loop has been ran. You the first lap it will be 0, the second lap it will be 1. You get it.
xxxxxxxxxx
i = 1
while i < [amount of times you want to loop + 1]
#your code
i = 1 + 1
xxxxxxxxxx
Q1Q = input('Why is a raven like a writing desk')
while True:
'Po Wrote on both'
break
else:
print("wrong")