logo CodeStepByStep logo

total_circle_area

Language/Type: Python functional programming lists collections

Write a function named total_circle_area that accepts a list of real numbers representing the radii of the circles as a parameter and returns the sum of the areas of a group of circles, rounded to the nearest integer. Recall that the area of a circle of radius r is π r2. For example, if the list is [3.0, 1.0, 7.2, 5.5], your function should return 289. If the list is empty, return 0.

Use Python's functional programming constructs, such as list comprehensions, map, filter, reduce, to implement your function. Do not use any loops or recursion in your solution.

Function: Write a Python function as described, not a complete program.

You must log in before you can solve this problem.

Log In

Need help?

Stuck on an exercise? Contact your TA or instructor.

If something seems wrong with our site, please

Is there a problem? Contact us.