Page 1 of 1

python programming

Posted: Fri Jul 08, 2022 6:38 am
by answerhappygod
python programming
Python Programming 1
Python Programming 1 (28.73 KiB) Viewed 39 times
Below is the Circle class we covered in the class. Write statements to create an instance of Circle with radius = 5; then calculate the area by calling its instance method. import math class Circle: # Construct a circle object definit__(self, radius = 1): self.radius = radius def getPerimeter (self): return 2* self.radius * math.pi def getArea(self): return self.radius *self.radius* math.pi def setRadius(self, radius): self.radius = radius