Question
A = [[1, 2, 3],
[4, 5, 6],
[7, 8, 9]]
[[col + 10 for col in row] for row in A]
a.
[[11, 12, 13], [14, 15, 16], [17, 18, 19]]
b.
Error
c.
[11, 12, 13], [14, 15, 16], [17, 18, 19]
d.
[11, 12, 13, 14, 15, 16, 17, 18, 19]
Posted under Python
Engage with the Community - Add Your Comment
Confused About the Answer? Ask for Details Here.
Know the Explanation? Add it Here.
Q. What is the output of the code shown?
Similar Questions
Discover Related MCQs
Q. Which of the following matrices will throw an error in Python?
View solution
Q. What is the list comprehension equivalent for:
{x : x is a whole number less than 20, x is even} (including zero)
View solution
Q. Write a list comprehension to produce the list: [1, 2, 4, 8, 16……212].
View solution
Q. What is the list comprehension equivalent for: list(map(lambda x:x**-1, [1, 2, 3]))
View solution
Q. Write a list comprehension for producing a list of numbers between 1 and 1000 that are divisible by 3.
View solution
Q. Write a list comprehension for number and its cube for l=[1, 2, 3, 4, 5, 6, 7, 8, 9].
View solution
Q. Write the list comprehension to pick out only negative integers from a given list ‘l’.
View solution
Q. Which of the following is the same as list(map(lambda x: x**-1, [1, 2, 3]))?
View solution
Q. Which of the following is the correct expansion of list_1 = [expr(i) for i in list_0 if func(i)] ?
View solution
Q. To which of the following the “in” operator can be used to check if an item is in it?
View solution
Q. Suppose listExample is [3, 4, 5, 20, 5, 25, 1, 3], what is list1 after listExample.pop()?
View solution
Q. Suppose listExample is [3, 4, 5, 20, 5, 25, 1, 3], what is list1 after listExample.pop(1) ?
View solution
Q. Suppose listExample is [3, 4, 5, 20, 5, 25, 1, 3], what is list1 after listExample.extend([34, 5]) ?
View solution
Q. Suppose list1 is [3, 4, 5, 20, 5, 25, 1, 3], what is list1 after list1.reverse() ?
View solution
Q. Suppose list1 is [1, 3, 2], What is list1 * 2 ?
View solution
Q. Suppose list1 is [2, 33, 222, 14, 25], What is list1[:-1] ?
View solution
Q. Suppose list1 is [2, 33, 222, 14, 25], What is list1[-1] ?
View solution
Q. Suppose list1 is [4, 2, 2, 4, 5, 2, 1, 0], Which of the following is correct syntax for slicing operation ?
View solution
Q. To shuffle the list(say list1) what function do we use ?
View solution
Q. Suppose list1 is [1, 5, 9], what is sum(list1) ?
View solution
Suggested Topics
Are you eager to expand your knowledge beyond Python? We've curated a selection of related categories that you might find intriguing.
Click on the categories below to discover a wealth of MCQs and enrich your understanding of Computer Science. Happy exploring!