Advertisement
CR7CR7

Figures

Feb 16th, 2021
825
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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
RAW Paste Data Copied
Advertisement