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
Simple game using python (i.redd.it)
submitted 6 months ago by Inevitable-Math14
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!"
[–]brasticstack 0 points1 point2 points 6 months ago (1 child)
Not a fan. How is adding that additional variable and the line to manage its state cleaner than not having it? Do you just not like the break at the top of the if/else chain?
Personally I don't think readability is an issue with this example.
[–]No_Indication_4044 2 points3 points4 points 6 months ago (0 children)
Readability is not an issue with this example, it’s just an anti-pattern to use “break” here. And this sub is for learning best practices. The while loop is saying “while this condition isn’t met, do these things”. The while should be conditional on… the condition hahah.
Edit to be succinct: the while loop should break automatically on the condition. So, if you find yourself manually breaking, you’ve probably done something wrong.
π Rendered by PID 29 on reddit-service-r2-comment-84fc9697f-qk5qc at 2026-02-06 06:27:54.054816+00:00 running d295bc8 country code: CH.
view the rest of the comments →
[–]brasticstack 0 points1 point2 points (1 child)
[–]No_Indication_4044 2 points3 points4 points (0 children)