def mapthe(jammers): nicks = ["technocake", "torthu"] ins = {} for i, jammer in enumerate(jammers): for nick in nicks: if username(nick) == username(jammer["Username"]): ins[nick] = 1 return list(ins)
def find_waiting_people(formjammers, filename, jammers, fieldnames): """ Finds jammers waiting for a seat """ formjammers_full = [jammer for jammer in formjammers] # List of usernames from both camps formjammers = [username(jammer["Username"]) for jammer in formjammers_full if username(jammer["Username"]) != ""] jammers = [username(jammer["Username"]) for jammer in jammers] # Match usernames in both camps for signed_up_jammer in jammers: if signed_up_jammer in formjammers: formjammers.remove(signed_up_jammer) # Convert the list of jammers from the google forms to a dict of jammers formjammers_dict = dict_jammers(formjammers_full) # Fetch full jammer info from the usernames waiting_jammers = [formjammers_dict[waiting_jammer] for waiting_jammer in formjammers] return formjammers, waiting_jammers
def whoose_account(jammers, email): for jammer in jammers: if jammer["Email"] == email: print(jammer.values()) print(username(jammer["Username"]))