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
22 changes: 22 additions & 0 deletions Code/Python/palindrome_number.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,25 @@
# OUTPUT:
# The given number is a palindrome.



'''Solution No. 2 Using String '''
n = int(input())
n_str = str(n) #convert it into string in order to do slicing
n_str = int(n_str[::-1]) #reversed the order by slicing

if n_str == n:
print("The given number is a Palindrome number.")
else:
print("The given number is not a Palindrome number.")


#TEST CASES :

'''1. Enter the number : 1252153374328989
The given number is not a Palindrome number.'''

'''2.Enter the number : 23455432
The given number is a Palindrome number.'''