RSS Forums RSS
Please support our Python advertiser: Programming Forums

Lists & Passwords

Join Date: May 2008
Posts: 10
Reputation: Capt.Micro is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
Capt.Micro Capt.Micro is offline Offline
Newbie Poster

Re: Lists & Passwords

  #2  
May 17th, 2008
Hello, Looking at your code, you only need one thing changed, the if parts part.

#Start of the program
print "Welcome To the Server!"
#Varible i'm using for later on in the program
a = 0

#The list of user names
user_list = ['sam','bob','tom']
#And list of passwords
pass_list1 = ['12','13','14']

#The prompt ofr the username and password
username = raw_input("Username: ")
for user in user_list:
    if username == user:
        password = raw_input("Password: ")
for pass in pass_list1:
    if password.lower() == pass:
       <insert rest of code here>

If you have any more questions, just ask.
Last edited by Capt.Micro : May 17th, 2008 at 1:13 am.
Reply With Quote  
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 11:10 pm.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC