Even or odd
Read one whole number and print Even if it is even or Odd if it is odd.
A number is even when dividing it by 2 leaves no remainder. The % operator gives the remainder.
Input
4
Expected output
Even
Input
7
Expected output
Odd
Show a hint
n % 2 is 0 for even numbers and 1 for odd ones (also for negative numbers in Python).
Show a solution
Loading the editor…
Run the tests to check your solution.