子类circle
This commit is contained in:
@@ -3,4 +3,7 @@ class Shape:
|
|||||||
return 0
|
return 0
|
||||||
class Circle(Shape):
|
class Circle(Shape):
|
||||||
def __init__(self, radius):
|
def __init__(self, radius):
|
||||||
self.radius = radius
|
self.radius = radius
|
||||||
|
|
||||||
|
def area(self):
|
||||||
|
return math.pi * self.radius * self.radius
|
||||||
Reference in New Issue
Block a user