2024-12-21 20:54:42 -05:00
|
|
|
# Program circle1.py
|
|
|
|
|
|
|
|
startUpMessage = '''
|
|
|
|
This program calculates the area of a circle.
|
|
|
|
|
|
|
|
'''
|
|
|
|
|
|
|
|
print(startUpMessage)
|
|
|
|
|
2024-12-21 20:50:38 -05:00
|
|
|
import math
|
|
|
|
PI = math.pi
|
|
|
|
|
|
|
|
radius = float(input("Enter the radius of a circle "))
|
|
|
|
|
|
|
|
area = PI * radius**2
|
|
|
|
|
2024-12-21 20:54:42 -05:00
|
|
|
print(f"The area is {area:.2f}")
|
|
|
|
print("\n")
|