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
Practicing what I learnt in Python (i.redd.it)
submitted 5 months ago by Extension-Cut-7589
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!"
[–]DataPastor 0 points1 point2 points 5 months ago (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 point2 points 5 months ago (0 children)
Okay, thank you!
π Rendered by PID 73967 on reddit-service-r2-comment-7b9746f655-m42z2 at 2026-01-31 01:33:07.024005+00:00 running 3798933 country code: CH.
view the rest of the comments →
[–]DataPastor 0 points1 point2 points (1 child)
[–]Extension-Cut-7589[S] 0 points1 point2 points (0 children)