tgoop.com/python_bds/710
Create:
Last Update:
Last Update:
The code shows a class Planet
with two init met
hods defined. In Python, a class cannot have multiple init met
hods; it can only have one init met
hod. If you try to define more than one, the last one defined will overwrite any previous definitions.
Therefore, when creating an instance of the Planet
class, the last init met
hod defined will be called, which in this case will print '2'
. So the output of the code will be 2
.
BY Python Learning

Share with your friend now:
tgoop.com/python_bds/710