Drop links or images here to add them to the editor.

In a make task you use the skills you have learned to create a program from scratch. There is no starter code: you begin with an empty editor.

Your task

Write a program that works out the tip on a restaurant meal.

The tip is 4.7
The total price is 28.2

To take 20% of a number, multiply it by 0.2.

Ask the question with its own print, exactly as written:

What did the meal cost?

The question is part of the checked output, so spelling, capital letters and punctuation count.

Rounding the amounts

Money has 2 decimal places, and the calculation does not respect that on its own: 20% of 7.25 comes out of Python as 1.4500000000000002. Round both amounts to 2 decimal places before you output them, with round(tip, 2) and round(total, 2).

Python outputs a rounded number without any trailing zeros, so do not expect 2 digits after the point every time. A tip of 4 pounds 70 is output as 4.7, and a tip of exactly 4 pounds is output as 4.0.

Example

Input:

23.50

Output:

What did the meal cost?
The tip is 4.7
The total price is 28.2

Input:

19.99

Output:

What did the meal cost?
The tip is 4.0
The total price is 23.99

(20% of 19.99 is 3.998, which rounds to 4.0)


Input:

12.99

Output:

What did the meal cost?
The tip is 2.6
The total price is 15.59
Help! My code doesn't work!

Make sure that you check for the following things:

  • You have used float() and not int(), since int() refuses a price with a decimal point in it.
  • You have typed the variable name exactly the same, capital letters included, every time.
  • There is a variable on the left of each assignment, and the data is on the right.
  • You have used a single = for assignment.
  • You have remembered the brackets after input, and the second closing bracket that float(input()) needs.
  • Every number that is concatenated into a print is wrapped in str().