Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import math
- figure = str(input())
- if figure == ('square'):
- size = float(input())
- print(f"{size * size:.3f}")
- elif figure == ('rectangle'):
- lenght = float(input())
- width = float(input())
- print(f"{lenght * width:.3f}")
- elif figure == ('circle'):
- radius = float(input())
- print(f"{(radius * radius) * math.pi:.3f}")
- elif figure == ('triangle'):
- base = float(input())
- height= float(input())
- print(f"{(height * base) / 2:.3f}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement