#Programming Exercise Chapter 2 Exercise 4 #Eric Stevens #04/02/2015 #Ask customer to input price of items 1-5 Item1=input("Please enter the price of your first item= $") print(Item1) Item2=input("Please enter the price of your second item= $") print(Item2) Item3=input("Please enter the price of your third item= $") print(Item3) Item4=input("Please enter the price of your fourth item= $") print(Item4) Item5=input("Please enter the price your your fifth item= $") print(Item5) #Customers subtotal Subtotal=Item1+Item2+Item3+Item4+Item5 print #Diplay subtotal print("Subtotal = $"),+Subtotal #Sales tax rate Tax=.06 #Total sales tax SalesTax=Subtotal*Tax #Display sales tax amount print("Sales Tax = $"),+SalesTax #Customers total Total=Subtotal+SalesTax #Display customers new total (sales tax + subtotal) print("Total = $"),+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