What will be the output of the following Python code?
>>>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]
Answer: b
Related Posts
What will be the output of the following JavaScript code?
int a=0;
for(a;a< 5;a++);
console.log(a);What will be the output of the following JavaScript code?
int size=5;
int a=5;
int size=4;
for(int j=size;j>=0;j–)
{
console.log(a);
a=a-2;
}What will be the output of the following JavaScript code?
var a= 0;
var b = 0;
while (a < 3)
{
a++;
b += a;
console.log(b);
}What will be the output of the following JavaScript code?
var a = 10;
do {
a += 1;
console.log(a);
} while (a < 5);What will be the output of the following JavaScript code?
function range(int length)
{
int a=5;
for(int i=0;i< length;i++)
{
console.log(a);
}
}range(3);Among the keywords below, which one is not a statement?
What could be the task of the statement debugger in the following JavaScript code?
function f(o)
{
if (o === undefined) debugger;
}
Join The Discussion