menu loop
A menu that keeps showing until a break runs.
while True:
choice = input("1 add, 2 quit: ")
if choice == "1":
pass
elif choice == "2":
break
else:
print("Please choose 1 or 2.")Console bridge: text in, text out · In any playground, open Reference to copy these.
A menu that keeps showing until a break runs.
while True:
choice = input("1 add, 2 quit: ")
if choice == "1":
pass
elif choice == "2":
break
else:
print("Please choose 1 or 2.")Leave the loop straight away; the program carries on after it.
breakName a group of steps, then run it by calling its name.
def shape():
pass
shape()def zigzag():
left(45)
forward(30)
right(90)
forward(30)
left(45)
zigzag()
zigzag()
zigzag()