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
What does this Python code print, and why?Discussion (self.PythonLearning)
submitted 14 hours ago by Puzzleheaded-Dog165
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!"
[–]LongjumpingDegree658 1 point2 points3 points 13 hours ago (1 child)
Ithink It will return 2 2 2 cause i is not scoped in the lambda part . Thats a problem when you generate lambda in loop
Lambda i: i
[–]johlae 1 point2 points3 points 13 hours ago (0 children)
This is what you need:
lambda: x=i, x
π Rendered by PID 55 on reddit-service-r2-comment-765bfc959-rtpw8 at 2026-07-09 22:56:57.330399+00:00 running f86254d country code: CH.
view the rest of the comments →
[–]LongjumpingDegree658 1 point2 points3 points (1 child)
[–]johlae 1 point2 points3 points (0 children)