-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbug1.py
More file actions
57 lines (53 loc) · 1.21 KB
/
Copy pathbug1.py
File metadata and controls
57 lines (53 loc) · 1.21 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
class Base:
def __init__(self, x, y, size):
self.x=x
self.y=y
self.size=size
def draw(self):
return ""
class Circle(Base):
def __init__(self, x, y, size):
super().__init__(x,y,size)
def draw(self):
return f"""
({self.x}, {self.y})
{self.size}
, - ~ ~ ~ - ,
, ' ' ,
, ,
, ,
, ,
, ,
, ,
, ,
, ,
, ,
' - , _ _ _ , '
"""
class Square(Base):
def __init__(self, x, y, size):
super().__init__(x,y,size)
def draw(self):
return f"""
({self.x}, {self.y})
{self.size}
--------------------
| |
| |
| |
| |
| |
| |
| |
| |
--------------------
"""
# All of the code below is correct
def draw_any_shape(myShape):
print(myShape.draw())
def main():
s = Square(1,2,3)
draw_any_shape(s)
c = Circle(2,2,1)
draw_any_shape(c)
main()