- 3
Fill in the blanks to break the infinite loop when the user enter 0. While true: x=input(). __x=='__'. ______
Important question
8 Answers
+ 6
Hello there!
A hint-tip for resolving your problem:
You can use the if/else/elif statements to check if, in this case, what the user enters in the input line. In addition of the statements you can use the break/continue keywords.
For some reasons I'm not able to share the link of the lessons about the break, so I'm sharing links of codes examples, perhaps helpful :)
https://code.sololearn.com/cw0SgnZds7pl/?ref=app
https://code.sololearn.com/c7plkKFHvOiB/?ref=app
If you want to learn more about the statements:
https://www.sololearn.com/learn/JUMP_LINK__&&__Python__&&__JUMP_LINK/2277/?ref=app
https://www.sololearn.com/learn/Python/2278/?ref=app
+ 4
May this code will help you
while True :
x=input()
if x=='0':
break
0
Thanku
0
Thanks all đ
0
1. if
2. 0
3. break
0
i = 0
while True:
print(i)
i = i + 1
if i >5:
break
0
while True :
x=input()
if x=='0':
break
0
if
and is break