Here you will get python program to check palindrome number.
在这里,您将获得用于检查回文数的python程序。
A number is said to be palindrome if it is equal to its reverse. For example 121, 555, etc are palindrome while 124, 367, etc are not.
如果数字等于其回数,则称其为回文。 例如121、555等是回文,而124、367等不是。
检查回文数的Python程序 (Python Program to Check Palindrome Number)
num = int(input("enter a number: "))
temp = num
rev = 0
while temp != 0:
rev = (rev * 10) + (temp % 10)
temp = temp // 10
if num == rev:
print("number is palindrome")
else:
print("number is not palindrome")
Output
输出量
enter a number: 12321 number is palindrome
输入数字:12321 是回文数
影片教学 (Video Tutorial)
翻译自: https://www.thecrazyprogrammer.com/2017/05/python-program-check-palindrome-number.html