adplus-dvertising
frame-decoration

Question

What is the output of the following code?
l=[1, -2, -3, 4, 5]
def f1(x):
    return x<-1
m1=map(f1, l)
print(list(m1))

a.

[False, False, False, False, False]

b.

[False, True, True, False, False]

c.

[True, False, False, True, True]

d.

[True, True, True, True, True]

Posted under Python

Answer: (b).[False, True, True, False, False]

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 following code?