Question & Answer: Given the following Python program, debug the code and get the output?…..

Given the following Python program, debug the code and get the output?

from abc import *

class Parent(object):

ssn = ‘ 667 35 3433’

@classmethod

@abstractmethod

def get_ssn(cls):

return ssn

class Daughter

def get_Name(self, name):

name = name

return self.name + super(Daughter, self).get_ssn()

girl1 = Daughter()

print(girl1.get_Name(‘Sara: ‘))

Expert Answer

 

from abc import *
class Parent(object):
#ssn = ‘ 667 35 3433’
@classmethod
@abstractmethod
def get_ssn(cls):
return ‘ 667 35 3433’

class Daughter(Parent):
def get_Name(self, name):
self.name = name
return self.name + Parent.get_ssn()
girl1 = Daughter()
print(girl1.get_Name(‘Sara: ‘))

Still stressed from student homework?
Get quality assistance from academic writers!