Let's write code that calculates the total bill at a restaurant, meal, plus tax, plus tip. We're going to prompt the user for the bill amount, the sales tax percentage, and the tip percentage, and then we'll print out that total bill amount in the format the total bill is and some dollar amount. Make sure you apply the tip after you add the tax amount and round the total bill amount to two decimal places. For example, let's say you went to a nice restaurant and ate a $30 meal. PA's sales tax is 6 percent, and you want to tip the waiter 18 percent. This should print, the total bill is $37.52. First, let's define some variables based on user input. So we'll create a variable bill, and we'll set that to the result of some input. How much is the meal? Remember, the input function returns a string by default, so we're going to actually cast that to a float. We'll allow the user to enter a decimal. We'll create another variable tax input. What is the sales tax as a percentage? We'll cast that to a float as well, and then tip. We're going to cast that to a float, and it's going to get user input. How much of a tip as a percentage? The first thing we're going to do is calculate the tax amount and then add the tax amount to the bill. So let's create a variable tax amount. That's going to be the value of the bill, multiplied by the tax, divided by 100. So this will calculate the tax. Then we're going to create a new variable total, which will be the bill plus the tax amount. So here we're calculating the tax amount based on user input, the user enters the bill, the user enters the tax amount or the percentage, and then we'll divide by 100, that will be the total tax amount, and then we'll add that to the bill. We'll store that in the variable total. So add tax amount to final bill. Then we're going to calculate and add the tip. So I'll say tip amount equal to, take the total so far, multiplied by the provided tip entered by the user. Again, it's a percentage, so we're going to divide by 100. This is calculate the tip, and then we're going to add that, so the total equal to total plus the tip amount, add tip amount to final bill. Then we're going to round the final bill amount to two decimal places. So we'll do that with the round function. So total equals, using the built-in round function, we'll give it the value we want to round, that is the total itself to two decimal places, the second argument to the round function is the number of decimal places. So here we'll round the total amount. Finally, let's print the final amount. So print the total bill is, that, comma, then the second thing to print is the total itself. We'll print the final amount. Check our code, let's go ahead and run it. How much is the meal? We'll say $30. How much is the sales tax? 6 percent. How much to tip the waiter? 18 percent. The total bill is 37.52. There's a little space in here, I'm going to fix that by adding a separator between the values that are printed in the print function, by default, it's a single-space. Let's override that using the SEP or the separator argument. We'll run that. How much is the meal? 30. Percentage? 6. Tip? 18 percent. The total bill is 37.52. Let's run it one more time. How much is the meal? 30.52. Sales tax? Let's say 8 percent, and I'm going to tip 30 percent. The total bill is 42.85.