Filter with a Comprehension
Completed
Read a line of integers and print only the even ones, each doubled, as a list.
Input
One line of space-separated integers.
Output
The list.
Example
Input
1 2 3 4 5 6
Output
[4, 8, 12]
Editor
Python
Hints
Add an if at the end of a comprehension to filter.
Solution explanation
[expr for x in items if condition] maps and filters in one step.
Show solution
nums = map(int, input().split())
print([x * 2 for x in nums if x % 2 == 0])