41. What is the default value of encoding in encode()?
42. What will be the output of the following Python code snippet?
print('{:$}'.format(1112223334))
print('{:$}'.format(1112223334))
43. What will be the output of the following Python code?
print('ab12'.isalnum())
print('ab12'.isalnum())
44. What will be the output of the following Python code?
print("ccdcddcd".find("c"))
print("ccdcddcd".find("c"))
45. To check whether string s1 contains another string s2, use . . . . . . . .
46. What will be the output of the following Python code snippet?
print('abef'.replace('cd', '12'))
print('abef'.replace('cd', '12'))
47. Suppose x is 345.3546, what is format(x, "10.3f") (_ indicates space).
48. What will be the output of the following Python statement?(python 3.xx)
>>>print(format("Welcome", "10s"), end = '#')
>>>print(format(111, "4d"), end = '#')
>>>print(format(924.656, "3.2f"))
>>>print(format("Welcome", "10s"), end = '#')
>>>print(format(111, "4d"), end = '#')
>>>print(format(924.656, "3.2f"))
49. What will be the output of the following Python code snippet?
print('for'.isidentifier())
print('for'.isidentifier())
50. What will be the output of the following Python code snippet?
print('ab\ncd\nef'.splitlines())
print('ab\ncd\nef'.splitlines())
Read More Section(Strings in Python)
Each Section contains maximum 100 MCQs question on Strings in Python. To get more questions visit other sections.