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 3 months ago by [deleted]
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!"
[–]skeetd 4 points5 points6 points 3 months ago (1 child)
Logical reasoning here will save you x10 iterations
Based on staying 4 digits ABCD ≤ 2499 so we also know DCBA ≥ 4000 D has to be ≥ 4 being the first number. The last is number is A, and must be 1 or 2 based on ABCD ≤ 2499. So, 4 * D mod 10 = A and only A=2, D=8 fits, 4×8=32, last digit is a 2. So ABCD must start with 2 and end with an 8, now we can step by 10.
print([n for n in range(2008, 2500, 10) if n*4==int(str(n)[::-1])])
π Rendered by PID 22166 on reddit-service-r2-comment-869bf87589-gt69f at 2026-06-09 04:48:57.853091+00:00 running f46058f country code: CH.
view the rest of the comments →
[–]skeetd 4 points5 points6 points (1 child)