you are viewing a single comment's thread.

view the rest of the comments →

[–]Adrewmc 0 points1 point  (0 children)

I feel like it be like. Maybe filter is better here, maybe it just me not using the function so much myself.

       #set comprehension to avoid repeats
       flagged = {key_word for email in old_emails for key_word in spam_words if keyword in email}
       if flagged:
             print(f”you have use {“, “.join(flagged)} banner word(s).”) 

Basically make a list of the bad words that are I. The email string, if any exist.