0
I'm trying to make a tip calculator and not sure why it's not working
def main(): price = input("How much did you pay?") tip = input("How good was your service? Poor, average or excellent?") if tip == "Poor": tip_percent = .10 * price if tip == "Average": tip_percent = .15 * price if tip == "Excellent": tip_percent = .20 * price print(f"The tip would be $%.2f " % (tip_percent)) main()
1 Resposta
+ 2
Input is always string by default. So you have to convert price to int or float.