adplus-dvertising
frame-decoration

Question

What is the output of the following?
def to_upper(k):
    return k.upper()
x = ['ab', 'cd']
print(list(map(to_upper, x)))

a.

[‘AB’, ‘CD’].

b.

[‘ab’, ‘cd’].

c.

none of the mentioned

d.

error

Posted under Python

Answer: (a).[‘AB’, ‘CD’].

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?