The following code should run smoothly, but for some reason Terminal tells me that there is a problem with it. My question is at the bottom.
print 'Welcome to Cash Calculator!'
cash = input('How much was the original price of the services or goods you paid for, excluding vat?')
tip = input('How much more, as a percentage, would you like to give as a tip?')
tip = tip/100
print tip
vat = 1.2
cash_vat = cash * vat
can = (cash_vat + ((tip/100) * cash_vat))
can = cash_vat + tip * cash_vat
print """
Thank you for your co-operation.
The price excluding the tip is %r,
and the total price is %d.
""" % (cash_vat, can)
When the code above runs Terminal gives out:
Welcome to Cash Calculator!
How much was the original price of the services or goods you paid for, excluding vat?100
How much more, as a percentage, would you like to give as a tip?10
0
Thank you for your co-operation.
The price excluding the tip is 120.0,
and the total price is 120.
What seems to be the problem? It keeps thinking that the tip is 0. I am a complete beginner.