print('Welcome to Agarwal*Mart') print ('A loaf of bread costs 1 dollar.') print('a bottle of milk costs 2 dollars.') print ('A box of oranges cost 2 dollars.') print ('A pack of eggs cost 3 dollars.') print('How many loaves of bread do you want?') sLoaves = input() print('How many bottles of milk do you want?') sMilk = input() print('How many boxes of oranges do you want?') sOranges = input() print('How many packs of eggs do you want?') sEggs = input() iLoaves = int(sLoaves) iMilk = int(sMilk) iOranges = int(sOranges) iEggs = int(sEggs) iLoaf = 1 * iLoaves iMilks = 2 * iMilk iOrange = 2 * iOranges iEgg = 3 * iEggs iTotal = iLoaf + iMilks + iOrange + iEgg sTotal = str(iTotal) print('Your total is ' + sTotal + ' dollars. Thank you for shopping with us!')
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