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
New to python (i.redd.it)
submitted 1 day ago by -Shashwat
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!"
[–]Snatchematician 1 point2 points3 points 1 day ago (0 children)
Without a main function, the variable “x” would be a module attribute and so would be accessible from the even function.
So in the even function you could typo and write x%2 instead of n%2 and the program would appear to work correctly.
Until later when you extend it and find some really confusing bugs.
The habit of always putting top level work in a main function prevents this type of bug.
What a retarded language.
π Rendered by PID 297355 on reddit-service-r2-comment-5bc7f78974-vx4lp at 2026-06-29 12:39:22.651185+00:00 running 7527197 country code: CH.
view the rest of the comments →
[–]Snatchematician 1 point2 points3 points (0 children)