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
2021-10-29
最新推荐文章于 2025-12-16 10:44:31 发布
本文介绍了如何使用学生通讯管理系统v1.0,包括增加学员信息、删除学员、打印学员信息及退出系统的功能。通过代码示例展示了如何实现基本的学员管理操作。
6330

被折叠的 条评论
为什么被折叠?



