[Tutor] Invalid Syntax

ehsan faraz ehsan2324 at gmail.com
Sat Feb 25 05:35:21 EST 2017


Hello, I am working on the following assignment where “tip” is an invalid syntax. Can someone please tell me how to fix this? Here is what it should look like:

Welcome to Restaurant Helper. 
Enter the menu price for your meal: 100 
Enter your tip percentage: 15 T
he price of the meal is: 100.00 
The sales tax due is: 8.50 
The tip amount is: 15.00 
The total due is: 123.50

The program asks the diner for the menu price of the meal and what percentage of that price the diner wishes to give as a tip. 
The program then computes the sales tax amount, the tip amount, and the total that will be paid to the restaurant.
The program should assume that the local sales tax is 8.5 percent. Also, the program should compute the amount of the tip by applying the tip percentage only to the menu price. 


sales_tax = 0.085 * price

total_due = sales_tax * price + tip

tip = tip

print("Welcome to Restaurant Helper.")
price = int(input("Enter the menu price for your meal:")
tip = int(input("Enter your tip percentage:")
print("The price of the meal is:" , price)
print("The sales tax due is:" , sales_tax)
print("The tip amount is:" , tip)
print("the total due is:" , total_due) 


More information about the Tutor mailing list