← Back to the lesson: Conditions
Even or Odd
The exercise
Variable n = 7.
Check if n is even or odd.
If even, print "Even".
If odd, print "Odd".
Hint: Use n % 2. If n % 2 == 0, the number is even.
Starter code
n = 7
# Check even or odd / Проверьте чётное или нечётное
Write the code in the browser and run it — no installation needed.