97.
What will be the output of the following Python code?
class Name:
    def __init__(self, firstName, mi, lastName):
        self.firstName = firstName
        self.mi = mi
        self.lastName = lastName
 
firstName = "John"
name = Name(firstName, 'F', "Smith")
firstName = "Peter"
name.lastName = "Pan"
print(name.firstName, name.lastName)

100.
What will be the output of the following Python code snippet?
print('The sum of {0} and {1} is {2}'.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.