Note 6.5.1.
The ActiveCode exercises don’t provide a way to stop an infinite loop like you would find in an IDE. To stop the code running in this book, refresh the page.
break
to break out of the loop.)while True:
and there is no break, then that is another case of an infinite loop!while True:
print("Will this stop?")
print("We have escaped.")
account_balance = 0
enough_money = 1000
while account_balance < enough_money:
print("account_balance: ", account_balance)
print("enough_money: ", enough_money)
account_balance += 100
enough_money += 10
print("Final account_balance: ", account_balance)