Advertisement
CR7CR7

Figures

Feb 16th, 2021
949
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.52 KB | None | 0 0
  1. import math
  2.  
  3. # square, rectangle, circle или triangle):
  4. shape = input()
  5.  
  6. if shape == "square":
  7.     a = float(input())
  8.     face = a * a
  9.     print(round(face,3))
  10. elif shape == "rectangle":
  11.     a = float(input())
  12.     b = float(input())
  13.     face = a * b
  14.     print(round(face,3))
  15. elif shape == "circle":
  16.     radius = float(input())
  17.     face = math.pi * (radius * radius)
  18.     print(round(face,3))
  19. elif shape == "triangle":
  20.     a = float(input())
  21.     b = float(input())
  22.     face = (a * b) / 2
  23.     print(round(face,3))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement