File tree 2 files changed +56
-0
lines changed
2 files changed +56
-0
lines changed Original file line number Diff line number Diff line change
1
+ # Copyright (C) Deepali Srivastava - All Rights Reserved
2
+ # This code is part of Python course available on CourseGalaxy.com
3
+
4
+ class Person :
5
+ def greet (self ):
6
+ print ('I am a Person' )
7
+
8
+ class Teacher (Person ):
9
+ def greet (self ):
10
+ Person .greet (self )
11
+ print ('I am a Teacher' )
12
+
13
+ class Student (Person ):
14
+ def greet (self ):
15
+ Person .greet (self )
16
+ print ('I am a Student' )
17
+
18
+ class TeachingAssistant (Student , Teacher ):
19
+ def greet (self ):
20
+ Student .greet (self )
21
+ Teacher .greet (self )
22
+ print ('I am a Teaching Assistant' )
23
+
24
+ x = TeachingAssistant ()
25
+ x .greet ()
26
+
Original file line number Diff line number Diff line change
1
+ # Copyright (C) Deepali Srivastava - All Rights Reserved
2
+ # This code is part of Python course available on CourseGalaxy.com
3
+
4
+ class Person :
5
+ def greet (self ):
6
+ print ('I am a Person' )
7
+
8
+ class Teacher (Person ):
9
+ def greet (self ):
10
+ super ().greet ()
11
+ print ('I am a Teacher' )
12
+
13
+ class Student (Person ):
14
+ def greet (self ):
15
+ super ().greet ()
16
+ print ('I am a Student' )
17
+
18
+ class TeachingAssistant (Student , Teacher ):
19
+ def greet (self ):
20
+ super ().greet ()
21
+ print ('I am a Teaching Assistant' )
22
+
23
+ x = TeachingAssistant ()
24
+ x .greet ()
25
+
26
+ help (TeachingAssistant )
27
+ s = Student ()
28
+ s .greet ()
29
+
30
+
You can’t perform that action at this time.
0 commit comments