---
title: "Discussion on \"Finding Palindromes Using Python\" | Hashnode"
description: "Discussion on \"Finding Palindromes Using Python\". ECX 30 Days of Code\nDay 3\nPalindromic Numbers\nTask\nA palindromic number is a number that remains the same when its digits are reversed. Write a function that prints out all palindromic numbers less than a given input, and returns the total number of ..."
url: "https://hashnode.com/posts/finding-palindromes-using-python/625e3e749ad0ef10f07beebc"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Finding Palindromes Using Python](https://thecodingprocess.hashnode.dev/finding-palindromes-using-python?utm_source=hashnode&utm_medium=feed)

ECX 30 Days of Code Day 3 Palindromic Numbers Task A palindromic number is a number that remains the same when its digits are reversed. Write a function that prints out all palindromic numbers less than a given input, and returns the total number of ...

Apr 19, 2022 · 2 min read · thecodingprocess.hashnode.dev  
Updated Jan 22, 2023  
Read the article

-   [#python](https://hashnode.com/tag/python)
-   [#coding](https://hashnode.com/tag/coding)
-   [#learning](https://hashnode.com/tag/learning)
-   [#learning-journey](https://hashnode.com/tag/learning-journey)
-   [#python-beginner](https://hashnode.com/tag/python-beginner)

## Written by

[Favour Olumese](https://hashnode.com/@favourolumese)

@favourolumese

  
[View profile](https://hashnode.com/@favourolumese)

Python Developer

Hello, I am Favour. I am a Python Developer. The Coding Process is a place where I document and consolidate what I learn on my journey towards becoming a software engineer. Kindly join me. I am also a poet and non-fiction writer. You could visit https://favourolumese.medium.com to read my writings. Thank you.

## Responses 1

Markdown supported · ⌘↵ to post

[Siddharta Govindaraj](https://hashnode.com/@siddharta)

[Apr 19, 2022](https://hashnode.com/posts/finding-palindromes-using-python/625e3e749ad0ef10f07beebc/comment/625ef2949ad0ef10f07c0800)

Nice. Here is another approach using functions from `itertools`. I really like the functions in itertools for these kinds of problems

```
from itertools import count, takewhile

def is_palindromic(num):
    return num == int(str(num)[::-1])

def palindromic(max_num):
    all_numbers = count()
    nums_palindrome = (num for num in all_numbers if is_palindromic(num))
    return takewhile(lambda x: x < max_num, nums_palindrome)

output = list(palindromic(500))
print(output)
print(len(output))
```

[Favour Olumese](https://hashnode.com/@favourolumese)

[Apr 20, 2022](https://hashnode.com/posts/finding-palindromes-using-python/625e3e749ad0ef10f07beebc/comment/625ef2949ad0ef10f07c0800#reply-625faf6a9ad0ef10f07c15f5)

Thank you so much Siddharta. I love your approach.
