Given a list, count and print all the palindrome numbers in it.
Input: 10 121 133 155 141 252 Output: 121 141 252 Total palindrome nos. are 3 Input: 111 220 784 565 498 787 363 Output: 111 565 787 363 Total palindrome nos. are 4
1. Access an element from the list.
2. Now, in a temporary variable get its reverse value.
3. Now, compare the list element value by its reverse value, if both are same print the list element and increase the counter c by 1.
4. Carry on this procedure till list becomes empty.
5. Now, print the counter value i.e total number of palindrome numbers in given list.
121 141 252 Total palindrome nos. are 3 111 565 787 363 Total palindrome nos. are 4
- Python | Numbers in a list within a given range
- Python | Sort list of numbers by sum of their digits
- Python | Largest number possible from list of given numbers
- Python program to count Even and Odd numbers in a List
- Python | Check if list contains consecutive numbers
- Python | Convert Stream of numbers to list
- Python | Create list of numbers with given range
- Python | Extract numbers from list of strings
- Python | Multiply all numbers in the list (3 different ways)
- Python - Get summation of numbers in string list
- Python program to print odd numbers in a List
- Python program to print even numbers in a list
- Python program to find all Strong Numbers in given list
- Python program to print positive numbers in a list
- Python program to print negative numbers in a list
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.