What will be the output of the following Python code m=reduce(lambda x: x-3 in range(4, 10)) print(list(m))

1.  [1, 2, 3, 4, 5, 6, 7]

2.  No output

3.  [1, 2, 3, 4, 5, 6]

4.  Error

4

No output

Explanation :
No Explanation available for this question

Which of the following numbers will not be a part of the output list of the following Python code def sf(a): return a%3!=0 and a%5!=0 m=filter(sf, range(1, 31)) print(list(m))

1.  1

2.  29

3.  6

4.  10

4

10

Explanation :
No Explanation available for this question

The single line equivalent of the following Python code l=[1, 2, 3, 4, 5] def f1(x): return x

1.  filter(lambda x:x

2.  filter(lambda x, y: x

3.  filter(reduce x

4.  reduce(x: x

4

filter(lambda x:x<0, l)

Explanation :
No Explanation available for this question

What will be the output of the following Python code list(map((lambda x:x^2), range(10)))

1.  [0, 1, 4, 9, 16, 25, 36, 49, 64, 81]

2.  Error

3.  [2, 3, 0, 1, 6, 7, 4, 5, 10, 11]

4.  No output

4

[2, 3, 0, 1, 6, 7, 4, 5, 10, 11]

Explanation :
No Explanation available for this question

What will be the output of the following Python code odd=lambda x: bool(x%2) numbers=[n for n in range(10)] print(numbers) n=list() for i in numbers: if odd(i): continue else: break

1.  [0, 2, 4, 6, 8, 10]

2.  [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]

3.  [1, 3, 5, 7, 9]

4.  Error

4

[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]

Explanation :
No Explanation available for this question

What will be the output of the following Python code f=lambda x:bool(x%2) print(f(20), f(21))

1.  False True

2.  False False

3.  True True

4.  True False

4

False True

Explanation :
No Explanation available for this question

What will be the output of the following Python code import functools l=[1,2,3,4] print(functools.reduce(lambda x,y:x*y,l))

1.  Error

2.  10

3.  24

4.  No output

4

24

Explanation :
No Explanation available for this question

What will be the output of the following Python code l=[1, -2, -3, 4, 5] def f1(x): return x

1.  [1, 4, 5 ]

2.  Error

3.  [-2, -3]

4.  [1, -2, -3]

4

[1, -2, -3]

Explanation :
No Explanation available for this question

What will be the output of the following Python code l=[-2, 4] m=map(lambda x:x*2, l) print(m)

1.  [-4, 16]

3.  Error

4.  -416

4

Explanation :
No Explanation available for this question

What will be the output of the following Python code l=[1, -2, -3, 4, 5] def f1(x): return x

1.  [False, False, False, False, False]

2.  [False, True, True, False, False]

3.  [True, False, False, True, True]

4.  [True, True, True, True, True]

4

[False, True, True, False, False]

Explanation :
No Explanation available for this question

Interview Questions

 MongoDB Java Script Node JS PHP JQuery Python