Python Programming (2180711) MCQ

MCQs of Structured Types, Mutability and Higher-Order Functions

MCQ No - 1

The output of executing string.ascii_letters can also be achieved by:

(A) string.ascii_lowercase_string.digits
(B) string.ascii_lowercase+string.ascii_upercase
(C) string.letters
(D) string.lowercase_string.upercase

B
MCQ No - 2

What will be the output of the following Python statement?
>>>"a"+"bc"

(A) a
(B) bc
(C) bca
(D) abc

D
MCQ No - 3

What will be the output of the following Python statement?
>>>"abcd"[2:]

(A) a
(B) ab
(C) cd
(D) dc

C
MCQ No - 4

What arithmetic operators cannot be used with strings?

(A) +
(B) *
(C) -
(D) All of the mentioned

C
MCQ No - 5

What will be the output of the following Python statement?
>>>print('new' 'line')

(A) Error
(B) Output equivalent to print ‘new\nline’
(C) newline
(D) new line

C