This Python code creates a tip calculator that asks the user for the total bill amount, tip percentage (10, 12, or 15%), and number of people splitting the bill. It then calculates each person's share by dividing the total bill plus tip by the number of people and rounding to two decimal places. The final amount each person should pay is printed.
This Python code creates a tip calculator that asks the user for the total bill amount, tip percentage (10, 12, or 15%), and number of people splitting the bill. It then calculates each person's share by dividing the total bill plus tip by the number of people and rounding to two decimal places. The final amount each person should pay is printed.
This Python code creates a tip calculator that asks the user for the total bill amount, tip percentage (10, 12, or 15%), and number of people splitting the bill. It then calculates each person's share by dividing the total bill plus tip by the number of people and rounding to two decimal places. The final amount each person should pay is printed.
percentage_tip= input("What percentage tip would you like to give?10,12 or 15? ") total_people = input("How many people to spli the bill? ") each = (int(total_bill)/int(total_people)) * (1 + int(percentage_tip)/100) eachround = round(each,2) print(f"Each person should pay: {eachround}")