logo

AQA A-Level Computer Science practice

In Python, what is the result of applying map(lambda x: x * 2, [1, 3, 5]) and converting the result to a list?

Try the question first, then check the answer and practise the same topic again.

At a glance

MCQ

Type

practice

Style

Topic

Writing functional programs

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?.

  1. A.[2, 6, 10]
  2. B.[1, 3, 5, 2, 6, 10]
  3. C.[3, 5, 7]
  4. 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.

Related flashcards

No flashcards are published for this page yet.

Related practice questions