First steps, Numbers
Odd or even
The task
Return true if the number is even and false if it is odd. Zero is even; negative numbers can be either.
Hint: the remainder operator %.
Write a function called is_even.
Tests
| Call | Expected | Yours |
|---|---|---|
is_even(4) |
True |
not run |
is_even(7) |
False |
not run |
is_even(0) |
True |
not run |
is_even(-3) |
False |
not run |
is_even(-10) |
True |
not run |
solution.py
Tab indents. To leave the editor, press Escape, then Tab.
Output
Run prints what your code prints. Run the tests to check your function.