#get prices for all five items and convert data to a usable integer item1=raw_input('Enter price') print() item1=int(item1) item2=raw_input('Enter price') print() item2=int(item2) item3=raw_input('Enter price') print() item3=int(item3) item4=raw_input('Enter price') print() item4=int(item4) item5=raw_input('Enter price') print() item5=int(item5) #add item prices to get and display subtotal subtotal=item1+item2+item3+item4+item5 print(subtotal) #calculate and display tax salesTax=subtotal*.06 print(salesTax) #calculate and display total price total=subtotal+salesTax print(total)
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