How to get a value from a tuple when the tuple is a value of a dictionary?
Hi guys, I'm back again since I've got another None output. I'm trying to write a code that returns the password corresponding to a site. Here's my piece of code: data = {'facebook': ('facebook email', 'facebook password'), 'instagram': ('instagram email', 'instagram password'), 'yahoo mail': ('yahoo email', 'yahoo password')} site = input() for key in data: if site == key: psw = data.get(key[1]) # get the password, that stands at index 1 of the tuple print(psw) # output None Why is the output None? How can I print the second value of the tuple properly? P.S.: I cannot upload the file of the code, I'm sorry for that but the app doesn't work so you are supposed to copy and paste on your editor.