-
# info = [] # while True: # print('*****欢迎来到名片管理系统*****') # print(' 1.查看名片') # print(' 2.添加名片') # print(' 3.删除名片') # print(' 4.修改名片') # print(' 5.退出系统') # print('*' * 30) # choose = input('请选择:').strip() # def func(): # i = 0 # info_lenth = len(info) # while i < info_lenth: # print('%s.姓名:%s 年纪:%s 电话:%s' % (i, info[i]['name'], info[i]['age'], info[i]['phone'])) # i += 1 # if choose == '1': # if info: # func() # else: # print('空') # elif choose == '2': # name = input('name:').strip() # age = input('age:').strip() # phone = input('phone:').strip() # if name and age and phone: # info.append({ # 'name': name, # 'age': age, # 'phone': phone # }) # else: # print('请输入相应的信息') # elif choose == '3': # func() # res = input('请选择要删除的名片:') # info.remove(info[int(res)]) # print('删除成功!') # elif choose == '4': # func() # res2 = input('请选择要修改的内容:') # edit_name = input('姓名(回车不修改):').strip() # edit_age = input('年纪(回车不修改):').strip() # edit_phone = input('电话(回车不修改):').strip() # if edit_name: # info[int(res2)]['name'] = edit_name # if edit_age: # info[int(res2)]['age'] = edit_age # if edit_phone: # info[int(res2)]['phone'] = edit_phone # print('修改成功!) # elif choose == '5': # print('感谢使用!') # break # else: # print('请正确选择')