I'd like to receive a list of user aliases for the purpose of looking up an email. As of now, I can do this for only 1 input with the following code:
def Lookup(Dict_list):
user_alias = raw_input("Please enter User Alias: ")
data = []
for row in Dict_list:
#print "row test"
#print row
if user_alias in row.values():
print row
for row in Dict_list:
if user_alias == row['_cn6ca']:
email = row['_chk2m']
print email
return email
But I want to be able to have the user enter in an unknown amount of these aliases (probably no more than 10) and store the resulting emails that are looked up in a way that will allow for their placement in a .csv
I was thinking I could have the user enter a list [PaulW, RandomQ, SaraHu, etc...] or have the user enter all aliases until done, in which case they enter 'Done'
How can I alter this code (I'm guessing the raw_data command) to accomplish this?