Skip to content

Commit 8985fb5

Browse files
author
Fatma Degirmenci
committed
comment out lines causing errors
1 parent 1cecb6e commit 8985fb5

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

sprint5/inheritance.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@ def get_full_name(self) -> str:
2323
return f"{self.first_name} {self.last_name}{suffix}"
2424

2525
person1 = Child("Elizaveta", "Alekseeva")
26-
print(person1.get_name())
27-
print(person1.get_full_name())
26+
print(person1.get_name()) # it works because get_name inherited from Parent
27+
print(person1.get_full_name()) # works because Child has get_full_name method
2828
person1.change_last_name("Tyurina")
2929
print(person1.get_name())
3030
print(person1.get_full_name())
3131

3232
person2 = Parent("Elizaveta", "Alekseeva")
33+
print(person2.get_name()) # it works because get_name is Parent method
34+
# print(person2.get_full_name()) it doesn't work because Parent doesn't have this method
35+
# person2.change_last_name("Tyurina") it doesn't work because Parent doesn't have this method
3336
print(person2.get_name())
34-
print(person2.get_full_name())
35-
person2.change_last_name("Tyurina")
36-
print(person2.get_name())
37-
print(person2.get_full_name())
37+
# print(person2.get_full_name())

0 commit comments

Comments
 (0)