'''
Created on 2011-9-29
@author: xgzhao
'''
list2 = list('foo')
print list2
list2.remove('f')
print list2
print [i*2 for i in range(8) if i%2 == 0]
print [i for i in reversed(range(8))]
fdict = dict((['x', 1], ['y', 2]))
print fdict
tdict = {}
print tdict
print fdict.keys(), fdict.values(), fdict.items()
'''
Created on 2011-9-29
@author: xgzhao
'''
db = {}
def newUser():
prompt = 'login desired: '
while True:
name = raw_input(prompt)
if db.has_key(name):
prompt = 'name taken, try another'
continue
else:
break
pwd = raw_input('password: ')
db[name] = pwd
def oldUser():
name = raw_input('login: ')
pwd = raw_input('password: ')
passwd = db.get(name)
if passwd == pwd:
print 'Welcome back ', name
else:
print 'login incorrect'
def showmenu():
prompt = """
(N)ew User Login
(E)xisting User Login
(Q)uit
Enter choice = """