Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- item1 = int(input('Please input the price for your first item:' ))
- item2 = int(input('Please input the price for your next item:' ))
- item3 = int(input('Please input the price for your next item:' ))
- item4 = int(input('Please input the price for your next item:' ))
- item5 = int(input('Please input the price for your last item:' ))
- #These 5 lines take in the cost per item for 5 items. int causes the input to be taken in as an integer rather than a string and saves that integer into the variables "item1", "item2" and so on
- subtotal = (item1 + item2 + item3 + item4 + item5) #This line takes the costs collected and adds them together then puts that total in the variable "subtotal"
- tax = subtotal * .06 #This line takes the subtotal and multiplies it by the tax ammount provided and puts that value into the variable "tax"
- total = subtotal + tax#This line adds the subtotal and the tax and puts that value into the variable "total"
- print('Subtotal: ', subtotal)
- print('Tax (6%) : ', tax)
- print('Total: ', total)
- #These last 3 lines take the above variables and print them to the screen so that the user is able to see the subtotal, tax, and total of the 5 items
Add Comment
Please, Sign In to add comment