Python code for Dinner Calculator with Tip added

Dinner Calculator based on Tip Amount:

Below is the program that helps you calculate the amount per person for a dinner including the Tip you have given.

For Eg: 

If your bill is Rs.200 and your tip is 10, the. The Total bill will be Rs.210 and the amount will be shared based on the number of persons. if the number of persons is 5, then the amount per person will be 210/5 = Rs.22.

Below is the Python code to check your dinner price per person:

#Calculate your Dinner Price
price = float(input("Enter the total price:\n"))
no_of_persons = int(input("Enter the number of Persons:\n"))
tip = float(input("Enter the Tip Amount Provided:\n"))

total_price = price + tip

print(f'Total price including tip {total_price}')

price_per_person = total_price/no_of_persons

print(f'Cost per person {price_per_person}')
print("Thanks for using PGRSpot Dinner Calculator")

Post a Comment