Python - 12
Python - 12: While Loops
while loops repeat code as long as a condition is true.
👀 Show Example Solution
lives = 3
while lives > 0:
print("Lives left:")
print(lives)
lives = lives - 1
print("Game Over!")
Python - 12: While Loops
while loops repeat code as long as a condition is true.
lives = 3
while lives > 0:
print("Lives left:")
print(lives)
lives = lives - 1
print("Game Over!")