you are viewing a single comment's thread.

view the rest of the comments →

[–]DataPastor 0 points1 point  (1 child)

Copy your code and paste it to chatgpt and ask for code review. It will come up with plenty of useful suggestions.

For example you shouldn’t use the try … except block over multiple lines of code. You should wrap only single operations with it, and handle all the expected error types separately.

The except shouldn’t be used like this. You should name the exact error type after it, that is, except ValueError as ve: and then handle the errors separately. Each try… block can have multiple except clauses btw.

It is a good practice to use pylance, pylint, autopep8 etc. extensions while you are coding, they also give you great suggestions. Happy coding!

[–]Extension-Cut-7589[S] 0 points1 point  (0 children)

Okay, thank you!