Top 1000+ Solved Problem Solving and Python Programming MCQ Questions Answer
Q. To which of the following the “in” operator can be used to check if an item is in it?
a. lists
b. dictionary
c. set
d. all of the mentioned
Q. return result
a. return a list containing every third item from l starting at index 0
b. return an empty list
c. return a list containing every third index from l starting at index 0
d. return a list containing the items from l starting from index 0, omitting every third item
Q. print(veggies)
a. [‘carrot’, ‘celery’, ‘broccoli’, ‘potato’, ‘asparagus’] correct 1.00
b. [‘carrot’, ‘celery’, ‘potato’, ‘asparagus’]
c. [‘carrot’, ‘broccoli’, ‘celery’, ‘potato’, ‘asparagus’]
d. [‘celery’, ‘carrot’, ‘broccoli’, ‘potato’, ‘asparagus’]
Q. >>>m = [[x, x + 1, x + 2] for x in range(0, 3)]
a. [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
b. [[0, 1, 2], [1, 2, 3], [2, 3, 4]]
c. [1, 2, 3, 4, 5, 6, 7, 8, 9]
d. [0, 1, 2, 1, 2, 3, 2, 3, 4]