Advertisement
go6odn28

cirkle

Feb 27th, 2024
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.38 KB | None | 0 0
  1. class Circle:
  2.     __pi = 3.14
  3.  
  4.     def __init__(self, diameter):
  5.         self.diameter = diameter
  6.  
  7.     def calculate_circumference(self):
  8.         return self.diameter * Circle.__pi
  9.  
  10.     def calculate_area(self):
  11.         return Circle.__pi * (self.diameter/2)**2
  12.  
  13.     def calculate_area_of_sector(self, angle):
  14.         return angle/360 * Circle.__pi * (self.diameter/2)**2
  15.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement