See I've made a short little login that works with a dictionary, but I don't know how to add something to the dictionary while the program is running, so if you know how to fix this can you please help. Much apperciated.

database = {'name1': '1234', 'name2': '5678', 'name3': '9012'}

name = raw_input('Enter username: ')

pass = raw_input('Enter password: ')

if pass in database[name]:
       print 'Welcome', name
      pirnt 'Invalid password or username'

You mean you want to add the invalid username and password to the database?

'm trying to make a code for you, but have you realized you use keyword "pass"? which editor/IDE are you using?

database = [('name1','1234'), ('name2', '5678'), ('name3', '9012')]

name = raw_input('Enter username:\n ')

passwd = raw_input('Enter password:\n ')
found = False
for usrname, password in database:
   if((name==usrname) and (password==passwd)):
      print 'Welcome', name
      found = True

if(not found):
   print 'Invalid password or username'