16.
What will be the output of the following Python code?
class father:
    def __init__(self, param):
        self.o1 = param
 
class child(father):
    def __init__(self, param):
        self.o2 = param
 
>>>obj = child(22)
>>>print "%d %d" % (obj.o1, obj.o2)

17.
What will be the output of the following Python code snippet?
print('The sum of {0:b} and {1:x} is {2:o}'.format(2, 10, 12))

Read More Section(Strings in Python)

Each Section contains maximum 100 MCQs question on Strings in Python. To get more questions visit other sections.