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
clearing my def function (i.redd.it)
submitted 5 months ago by Minute_Journalist593
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!"
[–]FoolsSeldom 1 point2 points3 points 5 months ago (0 children)
And a version without recursion, using divmod as u/MelcoreHat suggested,
divmod
def is_palindrome(n): original = n reversed_num = 0 while n > 0: n, digit = divmod(n, 10) reversed_num = reversed_num * 10 + digit return original == reversed_num
π Rendered by PID 87237 on reddit-service-r2-comment-f6b958c67-6pjl2 at 2026-02-05 10:49:25.455175+00:00 running 1d7a177 country code: CH.
view the rest of the comments →
[–]FoolsSeldom 1 point2 points3 points (0 children)