Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion DIRECTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -577,8 +577,8 @@
* [Hardy Ramanujanalgo](maths/hardy_ramanujanalgo.py)
* [Hexagonal Number](maths/hexagonal_number.py)
* [Integration By Simpson Approx](maths/integration_by_simpson_approx.py)
* [Is Int Palindrome](maths/is_int_palindrome.py)
* [Is Ip V4 Address Valid](maths/is_ip_v4_address_valid.py)
* [Is Palindrome](maths/is_palindrome.py)
* [Is Square Free](maths/is_square_free.py)
* [Jaccard Similarity](maths/jaccard_similarity.py)
* [Juggler Sequence](maths/juggler_sequence.py)
Expand Down
14 changes: 7 additions & 7 deletions maths/is_palindrome.py → maths/is_int_palindrome.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
def is_palindrome(num: int) -> bool:
def is_int_palindrome(num: int) -> bool:
"""
Returns whether `num` is a palindrome or not
(see for reference https://en.wikipedia.org/wiki/Palindromic_number).

>>> is_palindrome(-121)
>>> is_int_palindrome(-121)
False
>>> is_palindrome(0)
>>> is_int_palindrome(0)
True
>>> is_palindrome(10)
>>> is_int_palindrome(10)
False
>>> is_palindrome(11)
>>> is_int_palindrome(11)
True
>>> is_palindrome(101)
>>> is_int_palindrome(101)
True
>>> is_palindrome(120)
>>> is_int_palindrome(120)
False
"""
if num < 0:
Expand Down