QuizSpace

Python week 8 important questions

Week 8 of Programming in Python: Collections (contd.), nested data. Extra important questions based on the recent, changing patterns of the exams, from basic to advanced. Practise them in learning mode: each question has a worked solution.

Question 1

One correct option

What is printed by the following program?

M = [[8, 6, 8, 2], [2, 2, 7, 2], [7, 6, 9, 6]]
print(len(M), len(M[0]), len(M) * len(M[0]))
  1. A

    3 4 7

  2. B

    3 4 12

  3. C

    3 5 12

  4. D

    4 3 12

Question 2

One correct option

What will be the output of the code below?

M = [[4, 1, 1, 5], [7, 4, 3, 3], [3, 6, 8, 3]]
print(M[1][2], M[0][0])
  1. A

    3 5

  2. B

    4 4

  3. C

    3 4

  4. D

    6 4

Question 3

One correct option

Consider the program given below. What does it print?

M = [[9, 4, 1, 8], [6, 9, 5, 9], [9, 3, 3, 7]]
print(len(M), len(M[0]), len(M) * len(M[0]))
  1. A

    4 3 12

  2. B

    3 4 12

  3. C

    3 5 12

  4. D

    3 4 7

More questions in this week

Authorise with Google to see every question with its answer and explanation and practise it in learning mode.

IMPPractise OPPE 1 PYQs:PythonSystem CommandsJava