Python Program to find palindrome numbers in a list


In this program, You will learn how to find palindrome numbers in a list in Python.


data = [11, 12, 33, 44]

Example: How to find palindrome numbers in a list in Python

data = []
print("Enter how many number:", end="")
n = int(input())

print("Enter numbers:", end=" ")

for i in range(0, n):
    num = int(input())

    data.append(num)

print("Palindrome numbers are:", end="")

for i in range(0, n):
    num = data[i]
    rev = 0
    while num > 0:
        r = num % 10
        rev = rev * 10 + r
        num = int(num / 10)

    if rev == data[i]:
        print(data[i], end=" ")

Output:

Enter how many number:4
Enter numbers: 11
12
121
146
Palindrome numbers are:11 121

Xiith is created for educational, experimental, and schooling purpose. Examples on Xiith are made easier to make a better or basic understanding. Tutorials, testimonials, and examples are continuously checked to avoid delusion, but we cannot take complete responsibility of all programs on Xiith. When you are operating this site, you have to agree to read and accept our terms of use, cookie and privacy policy.Copyright © 2020 by Xiith. All Rights Reserved. About us.