Question 6
Sun Dec 18 2022 11:19:41 GMT+0000 (Coordinated Universal Time)
Saved by
@qeebza
#Question 6
import math
print("""
A - Rectangle
B - Triangle
C - Circle
""")
shape = input("Enter shape: ")
if shape.upper() == "A":
height = float(input("Enter height: "))
base = float(input("Enter base: "))
area = height * base
elif shape.upper() == "B":
height = float(input("Enter height: "))
base = float(input("Enter base: "))
area = 0.5 * height* base
elif shape.upper() == "C":
radius = int(input("Enter radius: "))
area = math.pi * radius ** 2
print("Area =", area)
content_copyCOPY
Comments