livepython.net

162. Python Program to Find the Area and Circumference of a Circle

Easymath

Overview

Use math.pi for the two classic circle formulas.

Problem Statement

Read the radius of a circle (it may have decimals). Print its area and its circumference, each with 2 decimal places. For example, for 5:

Area: 78.54
Circumference: 31.42

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

Input

One number, the radius. Example:

5

Output

The output for that example:

Area: 78.54
Circumference: 31.42

The tests try 4 different inputs.

Learn this firstChapter 18 · Python math Module: sqrt, pi, ceil and floor
solution.py
# write your code here

EXPECTED OUTPUT

1Area: 78.54
2Circumference: 31.42

YOUR OUTPUT

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