Question: Make a copy of your python program for exercise 2 and change the function so that it prints nothing and returns the area value it
- Make a copy of your python program for exercise 2 and change the function so that it prints nothing and returns the area value it calculated. Verify that the function is working correctly by calling the function several times with different radius values. Note that you will have to make the calling program print out the value. Discussion question: So why did we move the print statement out of the function only to include it in the calling program?
This is the program from discussion 2
import math
def circleArea(radius):
area = math.pi*(radius**2)
print(area)
return
radius_user = int(input("What is the radius"))
circleArea(radius_user)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
