Problem 125634 · easy · Level 01 Prerequisites & Setup

Area of a Circle

functions · math module · arithmetic · rounding

Write circle_area(r) that returns the area of a circle with radius r, rounded to 2 decimal places. Use the constant math.pi (the math module is already imported).

Examples

Input:  r = 2
Output: 12.57
Input:  r = 0
Output: 0.0

Constraints

  • 0 <= r <= 10**4

Goals

  • Use math.pi from the math module
  • Square a number and round the result
Starting Python…