Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import math
- # square, rectangle, circle или triangle):
- shape = input()
- if shape == "square":
- a = float(input())
- face = a * a
- print(round(face,3))
- elif shape == "rectangle":
- a = float(input())
- b = float(input())
- face = a * b
- print(round(face,3))
- elif shape == "circle":
- radius = float(input())
- face = math.pi * (radius * radius)
- print(round(face,3))
- elif shape == "triangle":
- a = float(input())
- b = float(input())
- face = (a * b) / 2
- print(round(face,3))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement