Rename is_palindrome.py to is_int_palindrome.py (#8768)

* Rename is_palindrome.py to is_int_palindrome.py

* updating DIRECTORY.md

---------

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
This commit is contained in:
Christian Clauss 2023-05-26 08:50:33 +02:00 committed by GitHub
parent a17791d022
commit dd3b499bfa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 8 deletions

View File

@ -577,8 +577,8 @@
* [Hardy Ramanujanalgo](maths/hardy_ramanujanalgo.py) * [Hardy Ramanujanalgo](maths/hardy_ramanujanalgo.py)
* [Hexagonal Number](maths/hexagonal_number.py) * [Hexagonal Number](maths/hexagonal_number.py)
* [Integration By Simpson Approx](maths/integration_by_simpson_approx.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 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) * [Is Square Free](maths/is_square_free.py)
* [Jaccard Similarity](maths/jaccard_similarity.py) * [Jaccard Similarity](maths/jaccard_similarity.py)
* [Juggler Sequence](maths/juggler_sequence.py) * [Juggler Sequence](maths/juggler_sequence.py)

View File

@ -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 Returns whether `num` is a palindrome or not
(see for reference https://en.wikipedia.org/wiki/Palindromic_number). (see for reference https://en.wikipedia.org/wiki/Palindromic_number).
>>> is_palindrome(-121) >>> is_int_palindrome(-121)
False False
>>> is_palindrome(0) >>> is_int_palindrome(0)
True True
>>> is_palindrome(10) >>> is_int_palindrome(10)
False False
>>> is_palindrome(11) >>> is_int_palindrome(11)
True True
>>> is_palindrome(101) >>> is_int_palindrome(101)
True True
>>> is_palindrome(120) >>> is_int_palindrome(120)
False False
""" """
if num < 0: if num < 0: