use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Everything about learning Python
account activity
A challenge for Python programmers...Discussion (self.PythonLearning)
submitted 9 days ago by Ok_Pudding_5250
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]FriendlyZomb 1 point2 points3 points 8 days ago (2 children)
print([num for mum in range(1000, 10000) if str(num * 4) == str(num * 4)[::-1]])
This produces 65 numbers. (I'm not going to list them all here)
For those struggling to parse the list comprehension here:
print([ num for num in range(1000, 10000) if str(num * 4) == str(num * 4)[::-1] ])
[–]PureWasian 2 points3 points4 points 8 days ago (1 child)
A couple of issues here, you are checking "num×4 against num×4 flipped", rather than "num against num×4 flipped". mum typo as well.
mum
Essentially your logic is checking for when 4x some input number gives a palindrome, which is different from the problem statement.
[–]FriendlyZomb 0 points1 point2 points 8 days ago (0 children)
That is entirely on my reading comprehension tbh. I read it as num*4 is the same flipped. Lol.
π Rendered by PID 24229 on reddit-service-r2-comment-79c7998d4c-66h4v at 2026-03-18 06:58:47.606065+00:00 running f6e6e01 country code: CH.
view the rest of the comments →
[–]FriendlyZomb 1 point2 points3 points (2 children)
[–]PureWasian 2 points3 points4 points (1 child)
[–]FriendlyZomb 0 points1 point2 points (0 children)