I want to write a simple login script for existing users, I've created a dictionary for it but my code doesn't work.
I've tried the following:
d = {'apple':'red','green':'lettuce','yellow':'lemon','orange':'orange'}
print "Please enter your username: "
user_name = raw_input()
print "Please enter your password: "
password = raw_input
for user_name,password in d:
if user_name in d and password in d:
print "great"
else:
print "Password incorrect!"
The code doesn't work, I always get incorrect password.