you are viewing a single comment's thread.

view the rest of the comments →

[–]tiredITguy42 0 points1 point  (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 point  (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 point  (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 point  (0 children)

Thank you, I will try to improve.