Advertisements
Advertisements
प्रश्न
Rewrite the following code after removing errors. Underline each correction and write the output after correcting the code:
class First():
def __init__(self):
print "first":
class Second(object):
def __init__(self):
print "second"
class Third(First, Second):
def __init__(self):
First.__init__(self):
Second.__init__(self):
print "that's it"
t=Third()t=Third()कोड लेखन
Advertisements
उत्तर
class First():
def __init__(self):
print "first"
class Second(object):
def __init__(self):
print "second"
class Third(First, Second):
def __init__(self):
First.__init__(self)
Second.__init__(self)
print "that's it"
t = Third()
Corrections:
def __init__(self):instead ofdef __init__(self):with missing/incorrect underscoresFirst.__init__(self)instead ofFirst.__init__(self):Second.__init__(self)instead ofSecond.__init__(self):t = Third()instead oft=Third()t=Third()
Output
first
second
that's itshaalaa.com
क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
