PRACTICE

Conditions

Lesson notes

Your task

Set n to 7. Use if/else to print Even or Odd depending on n.

Expected output
Odd
Loading…

OUTPUT

Worked solution
n = 7
if n % 2 == 0:
    print("Even")
else:
    print("Odd")

Checks compare printed output, not your approach. Several solutions can be valid.

← Back to courses