publish solutions
This commit is contained in:
@@ -1 +1,26 @@
|
||||
## Écrivez votre code ici !
|
||||
class Person:
|
||||
def __init__(self, name, age):
|
||||
self.name = name
|
||||
self.age = age
|
||||
|
||||
def display_details(self):
|
||||
print(self.name, self.age)
|
||||
|
||||
|
||||
class Employee(Person):
|
||||
def __init__(self, name, age, salary):
|
||||
self.salary = salary
|
||||
super().__init__(name, age)
|
||||
|
||||
def display_details(self):
|
||||
super().display_details()
|
||||
print(self.salary)
|
||||
|
||||
|
||||
test = Employee("test", 2, 2200)
|
||||
|
||||
test.display_details()
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user