Python编写学籍管理系统

XS=[]

def tianjia():
while True:
Students={}
print(“请依次输入新学生工号、电话号码、姓名、年级以回车结束信息每次输入”)
ss = input(“请输入学号”)
ss = int(ss)
if ss < 1000 or ss > 9999:
print(“学号格式输入错误,请输入4位的学号”)
continue
Students[‘xuhao’] = ss
ssg = input(“请输入电话号码”)
Students[‘phonenumber’] = ssg
Students[‘name’] = input(“请输入姓名”)
ssj = input(“请输入年级”)
Students[‘nianji’] = ssj
XS.append(Students)
sss = input(“如需继续添加请输入y退出请输入n\n”)
if sss == “y”:
continue
else:
print(“已添加以下学生信息”)
print(XS)
break

def chaxun():
while True:
c = 0
ssd = input(“请输入学生工号或姓名进行查询”)
ssd=int(ssd)
print(XS)
for i in range(len(XS)):
XSS = XS[i]
if XSS[‘xuhao’] == ssd:
print(XSS)
c += 1
if c == 0:
print(‘对不起您所要的信息未查询到,请确认先关信息后在查询

你可能感兴趣的:(python,python,开发语言,后端)