Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions maths/is_even.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
def is_even(n: int) -> bool:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please provide descriptive name for the parameter: n

"""
Check whether a number is even.
An even number is an integer divisible by 2.
Reference: https://en.wikipedia.org/wiki/Parity_(mathematics)
>>> is_even(10)
True
>>> is_even(7)
False
:param n: Integer number
:return: True if even, False otherwise
"""
return n % 2 == 0
Copy link

Copilot AI Dec 31, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The file is missing the standard doctest execution block that is present in other similar files in the maths directory. Please add the following at the end of the file to enable doctest execution:

if name == "main":
import doctest

doctest.testmod()

Copilot uses AI. Check for mistakes.