Write your own function that illustrates a feature that you learned in this unit . The function must take time at least one argument .
. The code for the function
. The inputs and outputs to three calls of your function
.A description of what features your function illustrates
# function for finding the area of a circle
def compute_surface(radius):
from math import pi
return pi * radius * radius
R = input("Enter radius: ")
S = compute_surface(float(R))
print("Area of circle with R = ", R, " is ", S)
R = input("Enter radius: ")
S = compute_surface(float(R))
print("Area of circle with R = ", R, " is ", S)
R = input("Enter radius: ")
S = compute_surface(float(R))
print("Area of circle with R = ", R, " is ", S)
Comments
Leave a comment