while True: print('who are you') username = input() if username != 'joy': continue print('would you like to check the number of soda?') password = input() if password == 'yes': break print('assess right') word = 'bottles' for soda_num in range(50,0,-1): print(str(soda_num) + word + 'of soda athome') print(str(soda_num) + word + 'of soda') print('take one drink, past it around') print(str(soda_num) + word + 'of soda at home') if soda_num == 10 print('we only have 10 bottles of soda') elif soda_num == 1: print('we have no more soda at home') else: last_num = soda_num - 1 if last_num == 1: word = 'bottles' print(str(soda_num) + word + 'of soda at home')
Run
Reset
Share
Import
Link
Embed
Language▼
English
中文
Python Fiddle
Python Cloud IDE
Follow @python_fiddle
Browser Version Not Supported
Due to Python Fiddle's reliance on advanced JavaScript techniques, older browsers might have problems running it correctly. Please download the latest version of your favourite browser.
Chrome 10+
Firefox 4+
Safari 5+
IE 10+
Let me try anyway!
url:
Go
Python Snippet
Stackoverflow Question