+ 1
How to make a user enter sentences in a str variable untill he inputs 0 (zero)?
2 Réponses
+ 4
sentence = input('Please enter your sentence: ')
while sentence ! = '0':
sentence = input('Please enter your sentence: ')
0
while true:
s = input('enter ur sentence:\n ')
if s == '0': break
print (s)
this will open an infinite loop,print everything u enter untill u enter 0,when the condition is met it will break and exit the loop