Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Circle:
- __py = 3.14
- def __init__(self, diameter):
- self.diameter = diameter
- self.radius = diameter / 2
- def calculate_circumference(self):
- return Circle.__py * self.diameter
- def calculate_area(self):
- return Circle.__py * self.radius * self.radius
- def calculate_area_of_sector(self, angle):
- return (angle / 360) * Circle.__py * self.radius * self.radius
- circle = Circle(10)
- angle = 5
- print(f"{circle.calculate_circumference():.2f}")
- print(f"{circle.calculate_area():.2f}")
- print(f"{circle.calculate_area_of_sector(angle):.2f}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement