(Jun-20-2017, 10:21 PM)ichabod801 Wrote: It's almost always better to iterate directly over the items in a list, rather than over the indexes of the list:
for pass in pass_list: if pass[0] == search_user: found = pass[1] breakNote that pass is a list of two items, so I'm grabbing the first item in that sub-list with the zero index. You can also use tuple assignment to make it even easier:
for user, pass in pass_list: if user == search_user: found = pass break
I'm still very new. If you don't mind explaining a little more closely, how exactly does this work? I don't understand how I would be able to print the password based on this code.