For [1, 2, 3, 4], the intended result is [4, 8]. For an empty list, it is []. Odd values are omitted, not doubled.
LEARN PYTHON · FREE PYTHON TOOL
Python Exercise Runner with Tests
Solve a beginner Python challenge, run automatic tests locally and receive immediate pass or retry feedback.
Python runtime preparing…
Write double_even_numbers(numbers). Return a new list containing each even number multiplied by two. Four tests must pass.
Your result will appear here.
A WORKED TASK
Solve a small challenge and learn from the tests
Implement double_even_numbers(numbers): return a new list containing only the even input numbers, doubled. Read the example comprehension, then rewrite it using an ordinary loop as practice. Run the tests after each change instead of guessing from one example.
A passing set of beginner tests covers the included cases, not every possible program property. It does not award an accredited qualification or execute against a remote judge.
What to check
- Return the list rather than only printing it.
- Keep the required function name so the tests can call your solution.
- Try zero, negative even numbers and repeated values. Do not mutate the input unless the task explicitly allows it.
TESTED & REVIEWED
Know what this tool does—and where to double-check
- Reviewed by
- HTML Online Viewer project
- Last reviewed
- Processing
- Code and supported files are processed in this browser tab. Runtime tools download Python WebAssembly, but do not intentionally upload your source.
- Important limitation
- The browser runtime is intentionally isolated and may not include every desktop package, system command or network feature. Verify production programs in their target Python environment.
EXAMPLE INPUT
Start small, then use your own data
Your solution
def double_even_numbers(numbers):
# Return a new list containing doubled even numbers only.
return [number * 2 for number in numbers if number % 2 == 0]For [1, 2, 3, 4], the intended result is [4, 8]. For an empty list, it is []. Odd values are omitted, not doubled.
COMMON QUESTIONS
Python Exercise Runner FAQ
Does this upload my code or files?
No. Processing happens locally in your browser. Runtime tools download Python itself, but your source is not sent to our server.
Why can the first Python run take longer?
The browser downloads and starts the Python WebAssembly runtime. Later runs in the same tab are normally much faster.
Can I stop a program that takes too long?
Yes. Runtime tools show a Stop button while Python is working. Stopping terminates the isolated worker and a clean runtime starts when needed.