diff --git a/计科2101郭圣辉21412030118/pythonProject3/.idea/inspectionProfiles/profiles_settings.xml b/计科2101郭圣辉21412030118/pythonProject3/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..105ce2d --- /dev/null +++ b/计科2101郭圣辉21412030118/pythonProject3/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/计科2101郭圣辉21412030118/pythonProject3/.idea/misc.xml b/计科2101郭圣辉21412030118/pythonProject3/.idea/misc.xml new file mode 100644 index 0000000..2a08db1 --- /dev/null +++ b/计科2101郭圣辉21412030118/pythonProject3/.idea/misc.xml @@ -0,0 +1,7 @@ + + + + + + \ No newline at end of file diff --git a/计科2101郭圣辉21412030118/pythonProject3/.idea/modules.xml b/计科2101郭圣辉21412030118/pythonProject3/.idea/modules.xml new file mode 100644 index 0000000..1fb3c8b --- /dev/null +++ b/计科2101郭圣辉21412030118/pythonProject3/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/计科2101郭圣辉21412030118/pythonProject3/.idea/pythonProject3.iml b/计科2101郭圣辉21412030118/pythonProject3/.idea/pythonProject3.iml new file mode 100644 index 0000000..2c80e12 --- /dev/null +++ b/计科2101郭圣辉21412030118/pythonProject3/.idea/pythonProject3.iml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/计科2101郭圣辉21412030118/pythonProject3/.idea/workspace.xml b/计科2101郭圣辉21412030118/pythonProject3/.idea/workspace.xml new file mode 100644 index 0000000..52c5881 --- /dev/null +++ b/计科2101郭圣辉21412030118/pythonProject3/.idea/workspace.xml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + 1716777043418 + + + + \ No newline at end of file diff --git a/计科2101郭圣辉21412030118/pythonProject3/学生管理系统/__init__.py b/计科2101郭圣辉21412030118/pythonProject3/学生管理系统/__init__.py new file mode 100644 index 0000000..bed0b4e --- /dev/null +++ b/计科2101郭圣辉21412030118/pythonProject3/学生管理系统/__init__.py @@ -0,0 +1,74 @@ +class_info =[] +def print_menu(): + print("---------------") + print("学生管理系统") + print("1:添加学生") + print("2:删除学生") + print("3:修改学生") + print("4:查询学生") + print("5:显示所有学生") + print("6:退出系统") + print("---------------") +def add_student(): + print("添加学生的功能") + global class_info + name = input("输入学生的姓名") + age = input("输入学生的年龄") + score = input("输入学生的分数") + + # 【姓名年龄分数输入】 + for student in class_info: + if class_info["name"] == name: + print("学生姓名重复") + return + student = { + "name": name, + "age": age, + "score": score + } + + class_info.append(student) + print("添加学生信息成功") + print(class_info) + + +def del_student(): + print("删除学生信息") + global class_info + name = input("请输入删除学生的姓名") + for student in class_info: + if student["name"] == name: + class_info.remove(student) + print("删除学生信息成功") + return + print("不存在该学生信息") + +def modify_student(): + global class_info + name = input("") + for student in class_info: + if student["name"] == name: + student["name"] = input("请输入修改后的学生姓名:") + # jx = input("是否继续修改") + # if jx == "y" or jx == "yes": + student["age"] = input("请输入修改后的学生年龄:") + student["score"] = input("请输入修该后的学生分数:") + print("修改学生信息成功") + return + print("输入的学生信息不存在") +def main(): #主要逻辑 + while True: + print_menu() + choose = int(input("请输入")) + + if choose == 1: + add_student() + elif choose == 2: + del_student() + elif choose == 3: + modify_student() + elif choose == 4: + pass + +if __name__ == '__main__' : + main() \ No newline at end of file