livepython.net

54. Python Program to Find a Rectangle's Area from Input

EasyConvert input

Overview

Read decimal numbers with float(input()).

Problem Statement

Read a length, then a width (they may have decimals), and print the area with two decimal places. For example, for 4 and 2.5, print:

Area: 10.00

Use input() with no prompt text: the tests type the input for you, and a prompt would end up in your output.

Input

One value per line, in this order. Example:

4
2.5

Output

The output for that example:

Area: 10.00

The tests try 3 different inputs.

Learn this firstChapter 7 · Convert Input to Numbers with int() and float()
solution.py
# write your code here

EXPECTED OUTPUT

1Area: 10.00

YOUR OUTPUT

Press Run to see your output here. Lines are compared with the expected output.