LearnPy Hub
← File Handling problems
Hard

Split Into Two Files

Read numbers on one line. Write the even ones to even.txt and the odd ones to odd.txt, one per line. Then read both files and print even: … and odd: … with the numbers separated by spaces (empty after the colon if none).

Input

One line.

Output

Two lines.

Sample 1

Input
1 2 3 4 5
Output
even: 2 4
odd: 1 3 5

Sample 2

Input
2 4
Output
even: 2 4
odd:
solution.py
Output appears here
Split Into Two Files · Python practice problem · LearnPy Hub