Explore topic-wise MCQs in Technical Programming.

This section includes 1007 Mcqs, each offering curated multiple-choice questions to sharpen your Technical Programming knowledge and support exam preparation. Choose a topic below to get started.

751.

What is the output of the following? print('a@ 1,'.islower())

A. True
B. False
C. None
D. Error
Answer» B. False
752.

What is the output of the following? print('abc'.islower())

A. True
B. False
C. None
D. Error
Answer» B. False
753.

What is the output of the following? print('for'.isidentifier())

A. True
B. False
C. None
D. Error
Answer» B. False
754.

What is the output of the following? print('__foo__'.isidentifier())

A. True
B. False
C. None
D. Error
Answer» B. False
755.

What is the output of the following? print('my_string'.isidentifier())

A. True
B. False
C. None
D. Error
Answer» B. False
756.

What is the output of the following? print(''.isdigit())

A. True
B. False
C. None
D. Error
Answer» C. None
757.

What is the output of the following? print('0xa'.isdigit())

A. True
B. False
C. None
D. Error
Answer» C. None
758.

What is the output of the following? print('a B'.isalpha())

A. True
B. False
C. None
D. None
Answer» C. None
759.

What is the output of the following? print('ab'.isalpha())

A. True
B. False
C. None
D. Error
Answer» B. False
760.

What is the output of the following? print('ab,12'.isalnum())

A. True
B. False
C. None
D. Error
Answer» C. None
761.

What is the output of the following? print('ab12'.isalnum())

A. True
B. False
C. None
D. Error
Answer» B. False
762.

What is the output of the following? print('{0:.2%}'.format(1/3))

A. 0.33
B. 0.33%
C. 33.33%
D. 33%
Answer» D. 33%
763.

What is the output of the following? print('{0:.2}'.format(1/3))

A. 0.333333
B. 0.33
C. 0.333333:.2
D. Error
Answer» C. 0.333333:.2
764.

What is the output of the following? print('{:#}'.format(1112223334))

A. 1,112,223,334
B. 111,222,333,4
C. 1112223334
D. Error
Answer» D. Error
765.

What is the output of the following? print('{:$}'.format(1112223334))

A. 1,112,223,334
B. 111,222,333,4
C. 1112223334
D. Error
Answer» E.
766.

What is the output of the following? print('{:,}'.format('1112223334'))

A. 1,112,223,334
B. 111,222,333,4
C. 1112223334
D. Error
Answer» E.
767.

What is the output of the following? print('{:,}'.format(1112223334))

A. 1,112,223,334
B. 111,222,333,4
C. 1112223334
D. Error
Answer» B. 111,222,333,4
768.

What is the output of the following? print('The sum of {0:b} and {1:x} is {2:o}'.format(2, 10, 12))

A. The sum of 2 and 10 is 12
B. The sum of 10 and a is 14
C. The sum of 10 and a is c
D. Error
Answer» C. The sum of 10 and a is c
769.

What is the output of the following? print('The sum of {0} and {1} is {2}'.format(2, 10, 12))

A. The sum of 2 and 10 is 12
B. Error
C. The sum of 0 and 1 is 2
D. None of the mentioned
Answer» B. Error
770.

What is the output of the following? print("Hello {0[0]} and {0[1]}".format(('foo', 'bin')))

A. Hello foo and bin
B. Hello (‘foo’, ‘bin’) and (‘foo’, ‘bin’)
C. Error
D. None of the mentioned
Answer» B. Hello (‘foo’, ‘bin’) and (‘foo’, ‘bin’)
771.

What is the output of the following? print("Hello {0} and {1}".format(('foo', 'bin')))

A. Hello foo and bin
B. Hello (‘foo’, ‘bin’) and (‘foo’, ‘bin’)
C. Error
D. None of the mentioned
Answer» D. None of the mentioned
772.

What is the output of the following? print("Hello {0!r} and {0!s}".format('foo', 'bin'))

A. Hello foo and foo
B. Hello ‘foo’ and foo
C. Hello foo and ‘bin’
D. Error
Answer» C. Hello foo and ‘bin’
773.

What is the output of the following? print("Hello {name1} and {name2}".format(name1='foo', name2='bin'))

A. Hello foo and bin
B. Hello {name1} and {name2}
C. Error
D. Hello and
Answer» B. Hello {name1} and {name2}
774.

What is the output of the following? print("Hello {name1} and {name2}".format('foo', 'bin'))

A. Hello foo and bin
B. Hello {name1} and {name2}
C. Error
D. Hello and
Answer» D. Hello and
775.

What is the output of the following? print("Hello {} and {}".format('foo', 'bin'))

A. Hello foo and bin
B. Hello {} and {}
C. Error
D. Hello and
Answer» B. Hello {} and {}
776.

What is the output of the following? print("Hello {1} and {0}".format('bin', 'foo'))

A. Hello foo and bin
B. Hello bin and foo
C. Error
D. None of the mentioned
Answer» B. Hello bin and foo
777.

What is the output of the following? print("Hello {0} and {1}".format('foo', 'bin'))

A. Hello foo and bin
B. Hello {0} and {1} foo bin
C. Error
D. Hello 0 and 1
Answer» B. Hello {0} and {1} foo bin
778.

What is the output of the following? print("ccdcddcd".find("c"))

A. 4
B. 0
C. Error
D. True
Answer» C. Error
779.

What is the output of the following? print("abcdef".find("cd"))

A. True
B. 2
C. 3
D. None of the mentioned
Answer» C. 3
780.

What is the output of the following? print("abcdef".find("cd") == "cd" in "abcdef")

A. True
B. False
C. Error
D. None of the mentioned
Answer» C. Error
781.

What is the output of the following? print("ab\tcd\tef".expandtabs('+'))

A. ab+cd+ef
B. ab++++++++cd++++++++ef
C. ab cd ef
D. none of the mentioned
Answer» E.
782.

What is the output of the following? print("ab\tcd\tef".expandtabs(4))

A. ab cd ef
B. abcdef
C. abcdef
D. ab cd ef
Answer» E.
783.

What is the output of the following? print("ab\tcd\tef".expandtabs())

A. ab cd ef
B. abcdef
C. abcdef
D. ab cd ef
Answer» B. abcdef
784.

What is the output of the following? print("xyyzxyzxzxyy".endswith("xyy", 0, 2))

A. 0
B. 1
C. True
D. False
Answer» E.
785.

What is the output of the following? print("xyyzxyzxzxyy".endswith("xyy"))

A. 1
B. True
C. 3
D. 2
Answer» C. 3
786.

What is the default value of encoding in encode()?

A. ascii
B. qwerty
C. utf-8
D. utf-16
Answer» D. utf-16
787.

What is the output of the following? print('abc'.encode())

A. abc
B. ‘abc’
C. b’abc
D. h’abc’
Answer» D. h’abc’
788.

What is the output of the following? print("xyyzxyzxzxyy".count('xyy', -10, -1))

A. 2
B. 0
C. 1
D. error
Answer» C. 1
789.

What is the output of the following? print("xyyzxyzxzxyy".count('xyy', 2, 11))

A. 2
B. 0
C. 1
D. error
Answer» C. 1
790.

What is the output of the following? print("xyyzxyzxzxyy".count('xyy', 0, 100))

A. 2
B. 0
C. 1
D. error
Answer» B. 0
791.

What is the output of the following? print("xyyzxyzxzxyy".count('yy', 2))

A. 2
B. 0
C. 1
D. none of the mentioned
Answer» D. none of the mentioned
792.

What is the output of the following? print("xyyzxyzxzxyy".count('yy', 1))

A. 2
B. 0
C. 1
D. none of the mentioned
Answer» B. 0
793.

What is the output of the following? print("xyyzxyzxzxyy".count('yy'))

A. 2
B. 0
C. error
D. none of the mentioned
Answer» B. 0
794.

What is the output of the following? print("abcdef".center(10, '12'))

A. 12abcdef12
B. abcdef1212
C. 1212abcdef
D. error
Answer» E.
795.

What is the output of the following? print("abcdef".center(7, '1'))

A. 1abcdef
B. abcdef1
C. abcdef
D. error
Answer» B. abcdef1
796.

What is the output of the following? print("abcdef".center(7, 1))

A. 1abcdef
B. abcdef1
C. abcdef
D. error
Answer» E.
797.

What is the output of the following? print('*', "abcde".center(6), '*', sep='')

A. * abcde *
B. * abcde *
C. *abcde *
D. * abcde*
Answer» D. * abcde*
798.

What is the output of the following? print('*', "abcdef".center(7), '*', sep='')

A. * abcdef *
B. * abcdef *
C. *abcdef *
D. * abcdef*
Answer» E.
799.

What is the output of the following? print('*', "abcdef".center(7), '*')

A. * abcdef *
B. * abcdef *
C. *abcdef *
D. * abcdef*
Answer» C. *abcdef *
800.

What is the output of the following? print("abcdef".center(0))

A. cd
B. abcdef
C. error
D. none of the mentioned
Answer» D. none of the mentioned