25 XP

5. Even or odd

Beginner input conditions

Your program reads one line holding a whole number. Print even if the number is even, or odd if it is odd, in lower case.

A number is even when it divides by 2 with nothing left over, and odd when 1 is left over. This works the same for zero and for negative numbers: 0 and -8 are even, and -3 is odd.

Example 1

Input7
Outputodd
Explanation7 divided by 2 is 3, with 1 left over.

Example 2

Input10
Outputeven
Explanation10 divided by 2 is 5, with 0 left over.

Example 3

Input0
Outputeven
Explanation0 divided by 2 is 0, with 0 left over.

Constraints

  • The number is a whole number from -1,000,000,000 to 1,000,000,000.
  • Print nothing else. A prompt inside input() is fine: the tests leave it out of the output.

Submit also runs 4 more tests you can't see.

Practises If / Elif / Else (lesson 8).

Code
# Read one whole number. Print "even" if it is even,
# or "odd" if it is odd.
n = int(input())