Write a while loop that counts up from 0 to 10 and then prints "done!"
More with While Loops
if
x = 5 while x > 0: if x % 2 == 0: print(x, "is even") else: print(x, "is odd") x = x - 1
else
while
break
n = 3 while n > 0: print(n) n = n - 1 else: print("Loop finished!")
while True: word = input("Type 'exit' to quit: ") if word == "exit": break
x = 0 while x < 5: x = x + 1 if x == 3: continue print(x)
What will this print?
x = 0 while x < 4: x = x + 1 if x == 2: continue if x == 3: break print(x)
Write a program that:
continue