You are viewing a single comment's thread. Return to all comments →
There is no need of else statement in init section. If age is not valid just set self age to zero.
if initialAge < 0: self.age = 0 print("Age is not valid, setting age to 0.")
Seems like cookies are disabled on this browser, please enable them to open this website
Day 4: Class vs. Instance
You are viewing a single comment's thread. Return to all comments →
There is no need of else statement in init section. If age is not valid just set self age to zero.