x=int(input("Enter a number to check whether it is a palindrome number or not here : "))
m=x
k=0
for j in range (m):
digit=m%10
k=k*10+digit
m=m//10
if k==x:
print("%d is a palindrome nukber"%(x))
else:
print("%d is not a palindrome number"%(x))
print()
Himanshu_13
0
Newbie Poster
Recommended Answers
Jump to PostI would create a function
IsPalindrome
that checks any string, then pass it a number converted to a string. Why bother with numbers at all? Actually, I did this and the function was four lines including the header.
All 3 Replies
rproffitt
2,565
"Nothing to see here."
Moderator
Reverend Jim
4,780
Hi, I'm Jim, one of DaniWeb's moderators.
Moderator
Featured Poster
DGPickett
20
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.