lundi 24 décembre 2018

Python if-else clarification

I am trying to build a rule that states if email ID in list_1 then send to mail1@mail.com and if email ID in list_2 then send to mail2@mail.com

list_1 = ['abc@mail.com','def@mail.com']
list_2 = ['123@mail.com','456@mail.com']
 if recipients in list_1:
        cc_list = 'mail1@mail.com'
    else:
        cc_list = 'mail2@mail.com'

However I see the above always sends out the mail to mail1@mail.com even if the recipient is in list_2

Aucun commentaire:

Enregistrer un commentaire