print('-' * 40)
print("欢迎使用学生通讯管理系统v1.0")
print("[1] 增加学员信息")
print("[2] 删除学员信息")
print("[3] 打印学员信息")
print("[4] 退出系统")
print('-' * 40)
students = []
while True:
n = int(input("请选择功能编号[1 - 4]:"))
if n == 1:
code = input("请输入学员学号:")
name = input("请输入学员姓名:")
tel = input("请输入学员电话:")
s = {"code": code, "name": name, "tel": tel }
students. append(s)
print(students)
elif n == 2:
code = input("请输入待删除的学号:")
for s in students:
if s["code"] == code:
students.remove(s)
print("删除成功")
break
else:
print("没有该学号的学生,删除失败!")
elif n == 3:
for x in students:
print("学号:%s\t姓名: %s\t电话: %s\n" % (x["code"],x["name"],))
else:
print('欢迎使用学生通讯管理系统v1.0')
break
05-05
673
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
01-18
1765
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交