Data types · 24 / 29 Exercise Easy

Invoice with format

Objective

Create a Python program that calculates the total of a purchase and shows it formatted as money.

Instructions

  • Read the price of an item (decimal) and the number of units (integer).
  • Calculate the total by multiplying both.
  • Show the total with two decimals and the € symbol, with this format: Total: 7.50 €. Use an f-string.
Input
2.5
3
Output
Total: 7.50 €

Open the editor in full screen: the statement on the left and your code, the output and the tests on the right.

Start exercise