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

  1. 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!