+ 4
Why does my code run infinetly?
while True: print("enter 'quit' to end program") user_input = (": ") if user_input == "quit": break
10 ответов
+ 6
Line 3 of your code should be:
user_input = input(": ")
+ 5
Because you have an infinite loop?
+ 4
What about this one: -
while True:
print("enter 'quit' to end the program")
user_input = input(": ")
if user_input == "quit":
break
+ 3
Cancel infinity loop
+ 1
Thank you!!!!
0
True will always be true.
0
The while loop is true so it continues till it is false
- 1
https://code.sololearn.com/WH0zR2nrL5Km/?ref=app
https://code.sololearn.com/WzP5NVW98VbH/?ref=app
https://code.sololearn.com/WCJyc43MdYFK/?ref=app
https://code.sololearn.com/w8Gps3JMQr6j/?ref=app