In this question 0 is taken to be an even number, but isn't 0 considered to be neither even nor odd like PI or infinity?
0 is actually an even integer. It is neither positive nor negative, but it is even.
If you'd like to review even and odd integers, I'd recommend reviewing the video lesson on even and odd integers.
You also may find the video lesson on testing integer properties useful.
For this problem, it's very convenient to use 0—an even integer—and 1—an odd integer—to test the various cases quickly.
You're right that pi is neither even nor odd, but it is also not an integer. Only integers can be even or odd.