---
title: "Comment by Siddharta Govindaraj on \"Finding Palindromes Using Python\" | Hashnode"
description: "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"
url: "https://hashnode.com/posts/finding-palindromes-using-python/625e3e749ad0ef10f07beebc/comment/625ef2949ad0ef10f07c0800"
---

[Discussion](https://hashnode.com/posts/finding-palindromes-using-python/625e3e749ad0ef10f07beebc)

Comment [Finding Palindromes Using Python](https://hashnode.com/posts/finding-palindromes-using-python/625e3e749ad0ef10f07beebc)

[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.
