generated from mwc/lab_names
12 lines
320 B
Python
12 lines
320 B
Python
# circle_area.py
|
|
# --------------
|
|
# By MWC Contributors
|
|
import math #imports pi constant
|
|
|
|
##Refactor with a function##
|
|
print("This program will calculate the area of a circle.")
|
|
radius = float(input("What is the circle's radius? "))
|
|
def circleArea(radius):
|
|
return math.pi * (radius ** 2)
|
|
|
|
print(circleArea(radius)) |