gsh7859456 1 year ago
parent 602db3f4a5
commit d0556d3795

@ -0,0 +1,6 @@
<component name="InspectionProjectProfileManager">
<settings>
<option name="USE_PROJECT_PROFILE" value="false" />
<version value="1.0" />
</settings>
</component>

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Black">
<option name="sdkName" value="Python 3.12 (pythonProject3)" />
</component>
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.12 (pythonProject3)" project-jdk-type="Python SDK" />
</project>

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/pythonProject3.iml" filepath="$PROJECT_DIR$/.idea/pythonProject3.iml" />
</modules>
</component>
</project>

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.venv" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

@ -0,0 +1,49 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="a8203ce3-b0c8-4ad5-9f2b-ded81a680f0f" name="Changes" comment="" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="FileTemplateManagerImpl">
<option name="RECENT_TEMPLATES">
<list>
<option value="Python Script" />
</list>
</option>
</component>
<component name="ProjectColorInfo"><![CDATA[{
"associatedIndex": 8
}]]></component>
<component name="ProjectId" id="2h20p3yWlg61xxLvE3HZLgdtNDy" />
<component name="ProjectViewState">
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent"><![CDATA[{
"keyToString": {
"Python.__init__.executor": "Run",
"RunOnceActivity.ShowReadmeOnStart": "true"
}
}]]></component>
<component name="SharedIndexes">
<attachedChunks>
<set>
<option value="bundled-python-sdk-babbdf50b680-746f403e7f0c-com.jetbrains.pycharm.community.sharedIndexes.bundled-PC-241.15989.155" />
</set>
</attachedChunks>
</component>
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="a8203ce3-b0c8-4ad5-9f2b-ded81a680f0f" name="Changes" comment="" />
<created>1716777043418</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1716777043418</updated>
</task>
<servers />
</component>
</project>

@ -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()
Loading…
Cancel
Save