Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
List Help
#1
Below is a snippet of my program.

I need to be able to match the user's input to a website and then print the password associated with that website. My initial though was to do an if statement to look for the website and then print the password but that's not working. Any help is much appreciated.

passwords = [["yahoo","XqffoZeo"],["google","CoIushujSetu"]]

print("Which website do you want to lookup the password for?")
for keyvalue in passwords:
    passwordToLookup = input()

passwords.index(passwordToLookup)

if keyvalue in passwords:
    print ('Yep, its in there.') #I just wrote this to test my code and then I was going to author the code to print the password.
else:
    print ('Not in there.')
Reply


Messages In This Thread
List Help - by slackerman73 - Dec-08-2019, 09:51 PM
RE: List Help - by ichabod801 - Dec-08-2019, 11:02 PM
RE: List Help - by slackerman73 - Dec-12-2019, 03:58 AM
RE: List Help - by ichabod801 - Dec-12-2019, 02:25 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020