while loop
Repeat the indented lines for as long as the condition is true.
while True:
passExample
r = 10
while r < 60:
circle(r)
r = r + 15
Console bridge: text in, text out · In any playground, open Reference to copy these.
Repeat the indented lines for as long as the condition is true.
while True:
passr = 10
while r < 60:
circle(r)
r = r + 15
Add to a variable: total += 5 is short for total = total + 5.
total += 1Start the total at 0 once, then add to it on every pass.
total = 0
while total < 10:
total += int(input("Add: "))Pick a random whole number between two values.
import random
n = random.randint(1, 10)