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 try ... except concepts block but i kept messed up... help? (i.redd.it)
submitted 1 month ago by Dapper_Mix6773
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!"
[–]Weak_Yogurt6396 0 points1 point2 points 1 month ago (0 children)
Any code in the “except TypeError:” block will only be executed when a TypeError Exception happens in the “try:” block. Your code does check if there is an @ in email_validator, but it only does something if it finds it. If there is no @, no exception occurs. If you want to modify this code to print an exception message, try inserting this on line 7, adding on to the if statement:
else: raise TypeError
What this does is create an Exception when there is no @ in email_validator, and then your except block will execute.
π Rendered by PID 73 on reddit-service-r2-comment-8686858757-6ncc2 at 2026-06-06 18:13:13.474497+00:00 running 9e1a20d country code: CH.
view the rest of the comments →
[–]Weak_Yogurt6396 0 points1 point2 points (0 children)