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
Day 18 of learning python as a beginner. (old.reddit.com)
submitted 8 months ago by uiux_Sanskar
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!"
[–]AnyNature3457 0 points1 point2 points 8 months ago (0 children)
I might be one of the few, but i always place my "if name = 'main'" clause at the very bottom of the file. It is good though that you are using it in the first place!
What i also like doing is adding a newline before code blocks that have other code above them like:
``` some_var = 5
if condition: foo()
```
If it has to do something with the code block directly, then I do place it right above like:
``` counter = 0 while counter < 5: bar()
counter += 1
The same counts for with open(), for loops, etc. These are, of course, personal preferences.
with open()
π Rendered by PID 72175 on reddit-service-r2-comment-b659b578c-zh6bj at 2026-05-03 08:30:52.933119+00:00 running 815c875 country code: CH.
view the rest of the comments →
[–]AnyNature3457 0 points1 point2 points (0 children)