02Even or Odd

    Very easyconditionsmath

    Write is_even(n) that returns True if the whole number n is even and False if it is odd.

    Examples

    Example 1
    >>> is_even(4)
    True
    Example 2
    >>> is_even(7)
    False

    Good to know

    • n can be zero or negative. Zero counts as even.

    Run examples checks the 2 examples above. Submit runs all 6 tests, including hidden edge cases, and marks the challenge solved.

    solution.py
    Loading Python…

    Test results show up here

    Write is_even in the editor, then run the examples. Use print() freely: its output is shown for each test.