Exam-style question
Try this first
In Python, what is the result of applying map(lambda x: x * 2, [1, 3, 5]) and converting the result to a list?.
- A.[2, 6, 10]
- B.[1, 3, 5, 2, 6, 10]
- C.[3, 5, 7]
- D.10
Answer and explanation
Concise answer
[2, 6, 10]
Why this is correct
map applies the given function to every element of the list. Each value is multiplied by 2, producing 2, 6 and 10.
Use the concise answer above for a quick check, then reveal the full model answer and detailed explanation.
Common mistake
No common mistake is linked to this question yet.
