子类circle
This commit is contained in:
@@ -4,3 +4,6 @@ class Shape:
|
|||||||
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