adplus-dvertising
frame-decoration

Question

What is the output of the following?
elements = [0, 1, 2]
def incr(x):
    return x+1
print(list(map(incr, elements)))

a.

[1, 2, 3].

b.

[0, 1, 2].

c.

error

d.

none of the mentioned

Posted under Python

Answer: (a).[1, 2, 3].

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?