Skip to content

Commit c06e677

Browse files
authored
Merge pull request #1 from assamidanov/week14
created new folder and copied the inheritence file
2 parents 8106936 + 914c5a3 commit c06e677

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

week14/inheritance.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
class Base:
2+
def __init__(self, x):
3+
self.x = x
4+
5+
def show(self):
6+
print('Base', self.x)
7+
8+
class Derivative(Base):
9+
def __init__(self):
10+
super().__init__(20)
11+
12+
self.name = ''
13+
14+
a = Base(10)
15+
b = Derivative()
16+
17+
18+
a.show()
19+
b.show()

0 commit comments

Comments
 (0)