When iterating through the list, users, I want to print the only the names of the users that are in a dictionary to congratulate them, then reuse the list to print users that have not completed the poll. Why after the 1st for loop of users, does the list gets changed, or how do I reset it as I thought the list was not being modified. The only way I can get this program to work is to make a 2nd list in the beginning of the program called testusers.
users = ['jen','seymor', 'patrick', 'tony', 'sarah','edward','billie','mark','jan']
testusers = users
favorite_languages = {
'jen': 'python',
'sarah': 'c',
'edward': 'ruby',
'phil': 'python',
'jan': 'python',
'mark': 'java',
}
print '\nThe following users have taken the poll\n'
for users in favorite_languages.keys():
print('\t'+users.title() + ", thank you for talking the poll.")
print '\nThe following "PERSONS" have not taken the poll.\n'
for ditcher in users:
if ditcher not in favorite_languages.keys():
print "Hey "+ ditcher.title()+ " take the poll!"