Hello! This is actually my first time posting on a forum, ever haha. Well I'm going through a book on python, thought I understood naming variables, but found that I don't know how to fix NameError: name 'tip_15' is not defined
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# Tip Buddy # Have User enter bill amount # output tip amount and # bill total # Patrick Crowley # 8/7/2017 # gather information from user bill = float ( input ( "Please enter amount shown on bill." )) # output tip amount by 15% and 20% tip20 = bill * 0.2 tip15 = bill * 0.15 # 15% print ( "\n\nIf your service was satisfactory today," , \ tip_15 , "is a resonable tip Based on 15%" ) print ( "Your total would be:" , bill + tip_15) #20 |