CJCoding With Joseph
15free / daySign inCreate account

Evens Into Their Own File

Input: one line of whole numbers separated by spaces, no prompt. Split it with split() and write every number to all.txt on its own line. Read all.txt back into a list of int values (use append), then write only the even ones (the remainder operator % decides) to evens.txt, one per line, in the same order. Finally read evens.txt with readlines, print its lines with end="" and then <n> even number(s) with the number of lines.

Expected Output:

8
12
10
3 even number(s)

= newline. The output ends with a newline — print one after the last line.

Hints4 available
Topics:
Files
📥 Auto-Input:
3 8 5 12 7 10\n
This input is automatically fed to your program's stdin
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Ctrl+Space to expand shortcuts (pr, inp, def)

Your Output

Run your code to see the output here...

Test Cases

Run your code to see test case results.