I am checking emails against two lists — a list of domains and a list of individual emails.
How would I construct the following try statement —
Try: 'email in email_list'
Except DoesNotExist: 'domain in domain list' # if email not found
Except DoesNotExist: 'print error message' # if both email and domain not found
What syntax do I need to use to construct this statement?
It sounds like you’re looking for something like:
There is probably no need for exceptions in this case.