Question 1
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]))3 4 73 4 123 5 124 3 12
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.
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]))3 4 7
3 4 12
3 5 12
4 3 12
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])3 5
4 4
3 4
6 4
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]))4 3 12
3 4 12
3 5 12
3 4 7
Authorise with Google to see every question with its answer and explanation and practise it in learning mode.