1. 首页
  2. 编程语言
  3. Python
  4. Python核心编程第七章7-5练习答案汇总

Python核心编程第七章7-5练习答案汇总

上传者: 2023-11-10 03:45:29上传 TXT文件 3.25KB 热度 13次
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
下载地址
用户评论