Question: Write a Python Code: Consider the class Circle class Circle: x = 0.0 # x coordinate of circle y = 0.0 # y coordinate of
Write a Python Code:
Consider the class Circle class Circle: x = 0.0 # x coordinate of circle y = 0.0 # y coordinate of circle r = 0.0 # radius
a) Write an instance method area that returns, as a float value, the area of its Circle object.
b) Write a method smaller that could be called by a statement like c3 = c1.smaller(c2)
The method should make c3 refer to the smaller of the circles represented by c1 and c2 (or c1 if they are the same size).
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
