Define a class named Circle which can be constructed by a radius. The Circle class has a method which can compute the area.
Topic: Define a class named Circle which can be constructed by a radius. The Circle class has a method which can compute the area.
Solution
class Circle(object): def __init__(self, r): self.radius = r def area(self): return self.radius**2*3.14
List all Python Programs