#------------------------------------------------------------------------------ # Circle3.py # Uses functions #------------------------------------------------------------------------------ import math # circle_area() # computes the area of a circle def circle_area(r): a = math.pi*(r**2) return a # end circle_area() # circle_circumference() # computes the circumference of a circle def circle_circumference(r): c = 2*math.pi*r return c # end circle_circumference() # print_circle() # prints area and circumference of circle def print_circle(r): a = circle_area(r) c = circle_circumference(r) # print the circumference and area of the circle print("The area of the circle is:", a) print("The circumference of the circle is:", c) # end print_circle() #-- main program -------------------------------------------------------------- print() # blank line # get the radius of a circle and print its area and circumference radius_string = input("Enter the radius of a circle: ") print_circle(float(radius_string)) print() # blank line # get the radius of another circle and print its area and circumference radius_string = input("Enter the radius of another circle: ") print_circle(float(radius_string)) print() # blank line # end program -----------------------------------------------------------------