Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import math
- figure = input()
- if figure == "square":
- a = float(input())
- area = a * a
- print(f"{area:.3f}")
- elif figure == "rectangle":
- b = float(input())
- hb = float(input())
- area2 = b*hb
- print(f"{area2:.3f}")
- elif figure == "circle":
- r = float(input())
- area3 = math.pi * r**2
- print(f"{area3:.3f}")
- elif figure == "triangle":
- m = float(input())
- n = float(input())
- area4 = (m * n)/2
- print(f"{area4:.3f}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement