-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbug1.py
More file actions
36 lines (32 loc) · 1.07 KB
/
Copy pathbug1.py
File metadata and controls
36 lines (32 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
class Base:
# TODO: there's code missing in one or more lines below
def __init__(self, x, y, size): #added missing initialization function
self.x = x
self.y = y
self.size = size
class Circle(Base): #added Base as parameter, which is the class that Circle inherits from
def __init__(self, x, y, size): #added missing parameters
super().__init__(x, y, size)
#adding shape function which explains the shape of the class (a circle)
def shape(self):
return "This is a circle"
def draw(self):
return f"""
({self.x}, {self.y})\n{self.size}
, - ~ ~ ~ - ,
, ' ' ,
, ,
, ,
, ,
, ,
, ,
, ,
, ,
, , '
' - , _ _ _ , '
"""
def main():
c = Circle(1, 2, 3)
print(c.shape(), end="") #added ,end="" to avoid the new line to match the expected output
print(c.draw())
main()