List and dictionary comprehensions

What does the positive-values doubling example produce?

Examples

Worked example

Input
[-2, 1, 0, 3]
Expected output
[2, 6]

Hints and solution

Hint 1

Write down the starting state and walk through one example by hand.

Reveal worked answer

The values 1 and 3 are positive. They become 2 and 6 in the original order.

Back to the lesson