forked from codebasics/py
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
d_p_beladiya
committed
Jan 25, 2021
1 parent
f2a8f36
commit d3229fb
Showing
4 changed files
with
40 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,14 @@ | ||
class Father: | ||
def __init__(self, name, lastname): | ||
self.name = name | ||
self.lastname = lastname | ||
class Animal: | ||
def __init__(self, living_place): | ||
self.living_place = living_place | ||
|
||
def printname(self): | ||
print(self.name, self.lastname) | ||
def printplace(self): | ||
print(self.living_place) | ||
|
||
class Son(Father): | ||
def __init__(self, name, lastname): | ||
super().__init__(name, lastname) | ||
class Dog(Animal): | ||
def __init__(self, living_place): | ||
super().__init__(living_place) | ||
|
||
x = Son("Darshan", "Beladiya") | ||
x.printname() | ||
x = Dog("zoo") | ||
x.printplace() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 11 additions & 3 deletions
14
Basics/python_basics/18_multiple_inheritance/multiple_inheritance.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 14 additions & 14 deletions
28
Basics/python_basics/18_multiple_inheritance/multiple_inheritance.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
class superMario(): | ||
def move(self): | ||
print('I am moving') | ||
class Teacher(): | ||
def teachers_action(self): | ||
print('I can teach') | ||
|
||
|
||
class jump(): | ||
def jump_above(self): | ||
print('I just jumped') | ||
class Engineer(): | ||
def Engineers_action(self): | ||
print('I can code') | ||
|
||
class mushroom(): | ||
def eat_mushroom(self): | ||
print('I have become big now') | ||
class Youtuber(): | ||
def youtubers_action(self): | ||
print('I can code and teach') | ||
|
||
|
||
class Mario(superMario, mushroom, jump): | ||
class Person(Teacher, Engineer, Youtuber): | ||
pass | ||
play = Mario() | ||
play.move() | ||
play.eat_mushroom() | ||
play.jump_above() | ||
coder = Person() | ||
coder.teachers_action() | ||
coder.Engineers_action() | ||
coder.youtubers_action() |