Mar-25-2017, 10:10 AM
(This post was last modified: Mar-25-2017, 10:24 AM by Liquid_Ocelot.)
Ok I managed to get it to print out the in the correct format but I am having trouble with printing the actual equation
So if the percentage is the user_input number * each number in taxlist / 100
I just need it to print out like this
5% tax on a Chocolate cake costing $17.50 is $0.88
10% tax on a Chocolate cake costing $17.50 is $1.75
15% tax on a Chocolate cake costing $17.50 is $2.62
20% tax on a Chocolate cake costing $17.50 is $3.50
25% tax on a Chocolate cake costing $17.50 is $4.38
And my code is now looking like this so I am just confused how to put that equation in there to get it to print out the tax result at the end for each number in the list
Thanks
No worries this has been understood and solved thanks heaps dude
So if the percentage is the user_input number * each number in taxlist / 100
I just need it to print out like this
5% tax on a Chocolate cake costing $17.50 is $0.88
10% tax on a Chocolate cake costing $17.50 is $1.75
15% tax on a Chocolate cake costing $17.50 is $2.62
20% tax on a Chocolate cake costing $17.50 is $3.50
25% tax on a Chocolate cake costing $17.50 is $4.38
And my code is now looking like this so I am just confused how to put that equation in there to get it to print out the tax result at the end for each number in the list
item = str(input("Please enter an item")) price = float(input("Price of the item $")) taxlist = [5,10,15,20,25] def result (price, tax2): total = price * taxlist[0,1,2,3,4,4] / 100 return total for tax in range(5, 26, 5): print("",tax,"% tax on a ",item," costing ",price," is",result,"")my output gives me a strange result too so It may just be something simple I am missing I am not sure lol
Please enter an itemCake Price of the item $17.50 5 % tax on a Cake costing 17.5 is <function result at 0x000001B4EB9201E0> 10 % tax on a Cake costing 17.5 is <function result at 0x000001B4EB9201E0> 15 % tax on a Cake costing 17.5 is <function result at 0x000001B4EB9201E0> 20 % tax on a Cake costing 17.5 is <function result at 0x000001B4EB9201E0> 25 % tax on a Cake costing 17.5 is <function result at 0x000001B4EB9201E0> Process finished with exit code 0Also can someone explain why my output of the price of the item drops off the zero at the end, It should be 17.50 not 17.5
Thanks
Moderator Larz60+: Fixed tags you had wrong '\' should be '/'
No worries this has been understood and solved thanks heaps dude