Please enter the next word: cat
#1: You entered cat
Please enter the next word: iguana
#2: You entered iguana
Please enter the next word: zebra
#3: You entered zebra
Please enter the next word: dolphin
#4: You entered dolphin
Please enter the next word: STOP
All done. 4 words entered.
t = 0
while 1:
word = input('Please enter the next word: ')
if (word == "STOP"):
break
else:
print('You entered', word)
t += 1;
result = "well done. {} words entered"
print(result.format(t))
Comments
Leave a comment