Advertisement
UniQuet0p1

Untitled

Mar 29th, 2021
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. import math
  2.  
  3.  
  4. def circle_length(r: int):
  5. if r <= 0:
  6. raise Exception("radius cannot be negative")
  7. else:
  8. c = 2 * math.pi * r
  9. return round(c, 2)
  10.  
  11.  
  12. def circle_area(r: int):
  13. if r <= 0:
  14. raise Exception("radius cannot be negative")
  15. else:
  16. s = math.pi * r * r
  17. return round(s, 2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement