Spocoman

08. Circle Area and Perimeter

Dec 8th, 2021 (edited)
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.43 KB | None | 0 0
  1. from math import pi
  2.  
  3. radius = float(input())
  4. area = radius ** 2 * pi
  5. perimeter = 2 * pi * radius
  6. print(f'{area:.2f}')
  7. print(f'{perimeter:.2f}')
  8.  
  9.  
  10. Или тарикатската:
  11.  
  12. from math import pi
  13.  
  14. radius = float(input())
  15.  
  16. print(f'{pi * radius ** 2:.2f}\n{2 * pi * radius:.2f}')
  17.  
  18. И тарикатската без math:
  19.  
  20. r = float(input())
  21. print(f'{r ** 2 * 3.141592653589793:.2f}\n{2 * 3.141592653589793 * r:.2f}')
  22.  
Add Comment
Please, Sign In to add comment