81. What will be the output of the following Python code?
>>> str1 = 'hello'
>>> str2 = ','
>>> str3 = 'world'
>>> str1[-1:]
>>> str1 = 'hello'
>>> str2 = ','
>>> str3 = 'world'
>>> str1[-1:]
82. What will be the output of the following Python code?
print("xyyzxyzxzxyy".count('xyy', 0, 100))
print("xyyzxyzxzxyy".count('xyy', 0, 100))
83. What will be the output of the following Python code?
print('''
\tfoo'''.lstrip())
print('''
\tfoo'''.lstrip())
84. hat will be the output of the following Python code snippet?
print('my_string'.isidentifier())
print('my_string'.isidentifier())
85. What will be the output of the following Python code?
print("ab\tcd\tef".expandtabs())
print("ab\tcd\tef".expandtabs())
86. What will be the output of the following Python code?
>>>example = "snow world"
>>>print("%s" % example[4:7])
>>>example = "snow world"
>>>print("%s" % example[4:7])
87. What will be the output of the following Python code?
print("Hello {1} and {0}".format('bin', 'foo'))
print("Hello {1} and {0}".format('bin', 'foo'))
88. What will be the output of the following Python code snippet?
print('{:,}'.format('1112223334'))
print('{:,}'.format('1112223334'))
89. What will be the output of the following Python code?
print('*', "abcde".center(6), '*', sep='')
print('*', "abcde".center(6), '*', sep='')
90. Say s="hello" what will be the return value of type(s)?
Read More Section(Strings in Python)
Each Section contains maximum 100 MCQs question on Strings in Python. To get more questions visit other sections.