Oct-04-2018, 01:28 PM
peoples = ['jen', 'sarah', 'edward', 'phil', 'jeff', 'cara', 'ben', 'adam', 'larry'] favorite_languages = { 'jen' : 'python', 'sarah' : 'c', 'edward' : 'ruby', 'phil' : 'python', 'jeff' : 'python', 'cara' : 'none', } for people in favorite_languages.keys(): if people in favorite_languages: print("Thanks " + people.title() + " for taking the survey.") if people not in favorite_languages: print(people + ", Please take the survey.")Output when run. The not gets overlooked.
Thanks Jen for taking the survey.
Thanks Sarah for taking the survey.
Thanks Edward for taking the survey.
Thanks Phil for taking the survey.
Thanks Jeff for taking the survey.
Thanks Cara for taking the survey.
------------------
(program exited with code: 0)
Press any key to continue . . .