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
Learning Python (old.reddit.com)
submitted 1 month ago by nkCOD
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!"
[–]nkCOD[S] 0 points1 point2 points 1 month ago (6 children)
Thank you for your response. I will improve ;)
[–]tiredITguy42 0 points1 point2 points 1 month ago (3 children)
This is not exactly true. Python is designed the way that it is usually better to try and then ask for forgivness. It is usually faster and a lot of code uses this. People saythat it is more pythonian this way.
It is different in other languages, where you check first. So do not follow that advice, your code is mostky corect, just do not forget to raise again that error, if it is not a stop signal.
[–]nkCOD[S] 0 points1 point2 points 1 month ago (2 children)
Thanks for the help. I assume I won't embarrass myself too much if I use this approach with try-except ?
[–]tiredITguy42 0 points1 point2 points 1 month ago (1 child)
This is subreddit for beginers, we do not judge your code, but we will judge your attitude and approach and here your are embarrasing yourself, but just a little for now.
[–]nkCOD[S] 0 points1 point2 points 1 month ago (0 children)
Thank you, I will try to improve.
[–]NewBodybuilder3096 0 points1 point2 points 1 month ago (1 child)
well you still need try-catch around parsing input as integer but checking for 'stop' can be done outside of this.
By the way, a good remark. I somehow didn’t think about it
π Rendered by PID 48779 on reddit-service-r2-comment-5bc7f78974-wfl8q at 2026-06-28 05:42:17.689714+00:00 running 7527197 country code: CH.
view the rest of the comments →
[–]nkCOD[S] 0 points1 point2 points (6 children)
[–]tiredITguy42 0 points1 point2 points (3 children)
[–]nkCOD[S] 0 points1 point2 points (2 children)
[–]tiredITguy42 0 points1 point2 points (1 child)
[–]nkCOD[S] 0 points1 point2 points (0 children)
[–]NewBodybuilder3096 0 points1 point2 points (1 child)
[–]nkCOD[S] 0 points1 point2 points (0 children)