61. What will be the output of the following Python code?
print('{0:.2}'.format(1/3))
print('{0:.2}'.format(1/3))
62. What will be the output of the following Python code?
print('xyxxyyzxxy'.lstrip('xyy'))
print('xyxxyyzxxy'.lstrip('xyy'))
63. The format function, when applied on a string returns . . . . . . . .
64. What will be the output of the following Python code?
print("abc DEF".capitalize())
print("abc DEF".capitalize())
65. What will be the output of the following Python code?
print('ab,12'.isalnum())
print('ab,12'.isalnum())
66. What will be the output of the following Python code?
print("xyyzxyzxzxyy".count('yy', 2))
print("xyyzxyzxzxyy".count('yy', 2))
67. What will be the output of the following Python code?
print("abcdef".find("cd") == "cd" in "abcdef")
print("abcdef".find("cd") == "cd" in "abcdef")
68. What will be the output of the following Python code?
print("Hello {0} and {1}".format(('foo', 'bin')))
print("Hello {0} and {1}".format(('foo', 'bin')))
69. What will be the output of the following Python code?
print("abcdef".center())
print("abcdef".center())
70. What will be the output of the following Python code?
>>>example = "snow world"
>>>example[3] = 's'
>>>print example
>>>example = "snow world"
>>>example[3] = 's'
>>>print example
Read More Section(Strings in Python)
Each Section contains maximum 100 MCQs question on Strings in Python. To get more questions visit other sections.