Python的学习(十七):学生信息管理系统

本文介绍了使用Python开发学生信息管理系统的全过程,包括需求分析、系统设计和各个核心功能的实现,如添加、删除、修改学生信息,查询,成绩排序以及统计学生总数。
摘要由CSDN通过智能技术生成

Python的学习(十七):学生信息管理系统

需求分析

  • 应该具备的功能
    1. 添加学生及成绩信息
    2. 将学生信息保存到文件中
    3. 修改和删除学生信息
    4. 查询学生信息
    5. 根据学生成绩进行排序
    6. 统计学生的总分

系统设计

  • 系统管理的7大模块
    1. 录入学生信息模块
    2. 查找学生信息模块
    3. 删除学生信息模块
    4. 修改学生信息模块
    5. 学生成绩排名模块
    6. 统计学生总人数模块
    7. 显示全部学生信息模块

image-20220209213142019

  • 系统业务流程

    image-20220209213255459

主函数设计

编号 功能
0 退出系统
1 录入学生信息,调用insert()函数
2 查找学生信息,调用search()函数
3 删除学生信息,调用delete()函数
4 修改学生信息,调用modify()函数
5 对学生成绩进行排序,调用sort()函数
6 统计学生总人数,调用total()函数
7 显示所有学生信息,调用show()函数
def main():
    while True:
        menu()
        choice = int(input('请输入你想要的选择:'))#将输入的字符转为int
        if choice in [0,1,2,3,4,5,6,7]:
            if choice == 0:
                answer = input('您确定要退出系统吗?y/n')
                if answer == 'y' or answer == 'Y':
                    print('谢谢您的使用!')
                    break
                else:
                    continue
            elif choice == 1:
                insert()#录入学生信息
            elif choice == 2:
                search()#查找学生信息
            elif choice == 3:
                delete()
            elif choice == 4:
                modify()
            elif choice == 5:
                sort()
            elif choice == 6:
                total()
            elif choice == 7:
                show()


def menu():
    print('=========================学生信息管理系统===========================')
    print('---------------------------功能菜单-------------------------------')
    print('\t\t\t\t\t\t\t0.退出系统')
    print('\t\t\t\t\t\t\t1.录入信息')
    print('\t\t\t\t\t\t\t2.查找信息')
    print('\t\t\t\t\t\t\t3.删除信息')
    print('\t\t\t\t\t\t\t4.修改信息')
    print('\t\t\t\t\t\t\t5.信息排序')
    print('\t\t\t\t\t\t\t6.统计人数')
    print('\t\t\t\t\t\t\t7.显示信息')
    print('----------------------------------------------------------------')

录入学生信息

def insert():
    student_list = []
    while True:
        id = input('请输入ID(如1001):')
        if not id:
            break
        name = input('请输入姓名:')
        if not name:
            break
        try:
            englight = int(input(</
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值