python programming

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

python programming

Post by answerhappygod »

python programming
Python Programming 1
Python Programming 1 (28.73 KiB) Viewed 38 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
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply