0

Inheritance Python Question

What is the result of this code? class A: def method(self): print(1) class B(A): def method(self): print(2) B().method()

16th Mar 2020, 10:56 AM
Ethan Youngman
Ethan Youngman - avatar
3 odpowiedzi
+ 3
The B class inherits class A but overrides the method method() It's answer is 2
16th Mar 2020, 10:58 AM
かんでん
かんでん - avatar
0
answer is 2
24th Jul 2021, 8:43 AM
Judson Leo
Judson Leo - avatar