Define the instance method inc_num_kids() for Personinfo inc_num_kids increments the member data num_kids. Sample output for the given program with one call to inc_num_kids(): Kids: 0 New baby, kids now: 1 1 class PersonInfo: def __init_(self): self.num_kids = 4 5 N FIXME: Write inc_nun_kids(self) 6 7 det incunun_kids(self): 8 self.num_kids += 1 9 10 personi - Person Info() 12 print("Kids:', personl.num_kids) 13 personi. inc_num_kids) 14 print("New baby, kids now: person1.num_kids) Run X Test aborted Exited with return code 1. Traceback (most recent call last): File "main.py", line 13, in personi.inc_num_kids() AttributeError: 'PersonInfo' object has no attribute 'inc_num_kids'



Answer :

Other Questions