Python核心编程第七章7-5练习答案汇总
db = {}
def manage_list():
prompt = """ (D)elete user (P)rint all user (Q)uit Enter choice:"""
done = False
while not done:
chosen = False
while not chosen:
try:
choice = raw_input(prompt).strip()[0].lower()
except (EOFError, KeyboardInterrupt):
choice = 'q'
print '\nYou picked: [%s]' % choice
if choice not in 'dpq':
print 'Invalid option, try again'
else:
chosen = True
if choice == 'q':
done = True
if choice == 'd':
delete_user()
if choice == 'p':
print_user()
def delete_user():
i = 0
user_list = []
for each_user in db.keys():
u
下载地址
用户评论