Home / Engineering / Problem Solving and Python Programming MCQs / Page 23

# Problem Solving and Python Programming MCQs | Page - 23

Dear candidates you will find MCQ questions of Problem Solving and Python Programming here. Learn these questions and prepare yourself for coming examinations and interviews. You can check the right answer of any question by clicking on any option or by clicking view answer button.

## Q. 221) ): print(foo(i))

(A) [0] [1] [2]
(B) [0] [0, 1] [0, 1, 2]
(C) [1] [2] [3]
(D) [1] [1, 2] [1, 2, 3]

(A) 3
(B) 5
(C) 25
(D) 1

(A) 1
(B) 9
(C) 15
(D) error

## Q. 224) To shuffle the list(say list1) what function do we use?

(A) list1.shuffle()
(B) shuffle(list1)
(C) random.shuffle(list1)
(D) random.shufflelist(list1)

## Q. 225) Suppose list1 is [4, 2, 2, 4, 5, 2, 1, 0], Which of the following is correct syntax for slicing operation?

(A) print(list1[0])
(B) print(list1[:2])
(C) print(list1[:-2])
(D) all of the mentioned

(A) error
(B) none
(C) 25
(D) 2

## Q. 227) Suppose list1 is [2, 33, 222, 14, 25], What is list1[:-1]?

(A) [2, 33, 222, 14]
(B) error
(C) 25
(D) [25, 14, 222, 33, 2]

(A) a
(B) daman
(C) error
(D) n

(A) 11
(B) 12
(C) 21
(D) 22

## Q. 230) Suppose list1 = [0.5 * x for x in range(0, 4)], list1 is:

(A) [0, 1, 2, 3]
(B) [0, 1, 2, 3, 4]
(C) [0.0, 0.5, 1.0, 1.5]
(D) [0.0, 0.5, 1.0, 1.5, 2.0]

Download our easy to use, user friendly Android App from Play Store. And learn MCQs with one click.