Skip to content
Open
Changes from 1 commit
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
8 changes: 8 additions & 0 deletions maths/is_even.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
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.
:param n: Integer number
:return: True if even, False otherwise
"""
Comment on lines 2 to 15
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 docstring is missing a URL reference to Wikipedia or another similar explanation. According to the project's CONTRIBUTING.md, all new algorithms must include at least one URL that points to Wikipedia or another similar explanation. Consider adding a reference such as https://en.wikipedia.org/wiki/Parity_(mathematics) at the beginning of the docstring or as a module-level docstring.

Copilot uses AI. Check for mistakes.
return n % 2 == 0
Comment on lines 1 to 16
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 function is missing doctests, which are required according to the project's CONTRIBUTING.md guidelines. All functions must include doctests that pass automated testing. Please add example test cases in the docstring showing the function's behavior with various inputs (e.g., positive even numbers, positive odd numbers, zero, and negative numbers).

Copilot uses AI. Check for mistakes.
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.