Python Strings Online Test. MCQs on Strings in Python Language. See Python MCQs for all Multiple Choice Questions related to Python Language
Python Strings Online Test
What will be the output of the following Python code snippet ??
print(‘1.1’.isnumeric())
a) True
b) False
c) None
d) Error
What will be the output of the following Python code ??
print(‘ab’.isalpha())
a) True
b) False
c) None
d) Error
What will be the output of the following Python code snippet ??
print(’11’.isnumeric())
a) True
b) False
c) None
d) Error
What will be the output of the following Python code ??
print(‘ab,12’.isalnum())
a) True
b) False
c) None
d) Error
Python Strings Online Test
What will be the output of the following Python code snippet ??
print(‘a@ 1,’.islower())
a) True
b) False
c) None
d) Error
What will be the output of the following Python code ??
print(‘ab12’.isalnum())
a) True
b) False
c) None
d) Error
What will be the output of the following Python code snippet ??
print(‘abc’.islower())
a) True
b) False
c) None
d) Error
What will be the output of the following Python code ??
print(‘{0:.2%}’.format(1/3))
a) 0.33
b) 0.33%
c) 33.33%
d) 33%
Python Strings Online Test
What will be the output of the following Python code snippet ??
print(‘for’.isidentifier())
a) True
b) False
c) None
d) Error
What will be the output of the following Python code ??
print(‘{0:.2}’.format(1/3))
a) 0.333333
b) 0.33
c) 0.333333:.2
d) Error
What will be the output of the following Python code snippet ??
print(‘abcdefcdghcd’.split(‘cd’, -1))
a) [‘ab’, ‘ef’, ‘gh’]
b) [‘ab’, ‘ef’, ‘gh’, ”]
c) (‘ab’, ‘ef’, ‘gh’)
d) (‘ab’, ‘ef’, ‘gh’, ”)
What will be the output of the following Python code ??
print(‘abcd’.partition(‘cd’))
a) (‘ab’, ‘cd’, ”)
b) (‘ab’, ‘cd’)
c) error
d) none of the mentioned
Python Strings Online Test
What will be the output of the following Python code snippet ??
print(‘abcdefcdghcd’.split(‘cd’, 0))
a) [‘abcdefcdghcd’]
b) ‘abcdefcdghcd’
c) error
d) none of the mentioned
What will be the output of the following Python code ??
print(‘abcdefcdgh’.partition(‘cd’))
a) (‘ab’, ‘cd’, ‘ef’, ‘cd’, ‘gh’)
b) (‘ab’, ‘cd’, ‘efcdgh’)
c) (‘abcdef’, ‘cd’, ‘gh’)
d) error
What will be the output of the following Python code snippet ??
print(‘abcdefcdghcd’.split(‘cd’))
a) [‘ab’, ‘ef’, ‘gh’]
b) [‘ab’, ‘ef’, ‘gh’, ”]
c) (‘ab’, ‘ef’, ‘gh’)
d) (‘ab’, ‘ef’, ‘gh’, ”)