Python realizes the development of student management system

Use python to complete a super basic student management system for your reference, the specific content is as follows

**Description: **

1、 This student management system is very, very simple, with only add, display, check, delete, and modify functions, which is easy to understand for Python novices.
2、 The storage of information only uses dictionaries and lists.
3、 Do not spray if you don't like it.

**Code: **

1、 Main loop frame

while True:print(info_str)
 action =input("Please enter what you want to do:")if action =='0':print("Goodbye.")break
 elif action =='1':print("New student information")

 elif action =='2':print("Show all students")

 elif action =='3':print("Query student information")

 elif action =='4':print("Delete student information")

 elif action =='5':print("Modify student information")else:print("There is an error in your input, please re-enter.")

2、 Source code

info_str ="""
*************************1. New student information
2. Show all students
3. Query student information
4. Delete student information
5. Modify student information
0. Exit system
*************************"""

""" Name, language score, math score, English score, total score"""
students =[{'Name':'Zhang Dapao','Chinese':'95','Math':'65','English':'65','Score':'215'},{'Name':'Zhang Yida','Chinese':'65','Math':'95','English':'65','Score':'215'},{'Name':'Snack','Chinese':'65','Math':'65','English':'95','Score':'215'},]while True:""""Main loop"""
 print(info_str)
 action =input("Please enter what you want to do:")if action =='0':"""End condition"""print("Sayonara.")break
 elif action =='1':print("New student information")
 Name =input("Please enter the name:")
 Chinese =input("Please enter the language score:")
 Math =input("Please enter math grades:")
 English =input("Please enter English score:")
 Score =int(Chinese)+int(Math)+int(English)
 student={'Name':Name,'Chinese':Chinese,'Math':Math,'English':English,'Score':Score
   }
 students.append(student)
 elif action =='2':print("Show all students")for student in students:print(student)
 elif action =='3':print("Query student information")
 Name =input('Please enter the name to be queried:')for student in students:if student['Name']== Name:print(student)else:print("{}Information does not exist".format(Name))
 elif action =='4':print("Delete student information")
 Name =input("Please enter the name to be deleted:")for student in students:if student['Name']== Name:
 students.remove(student)breakelse:print("{}Information does not exist".format(Name))
 elif action =='5':print("Modify student information")
 Name =input("Please enter the name to be modified:")for student in students:if student['Name']== Name:
 student['Name']=input("Please enter the name:")
 student['Chinese']=input("Please enter the language score:")
 student['Math']=input("Please enter math grades:")
 student['English']=input("Please enter English score:")
 student['Score']=int(student['Chinese'])+int(student['Math'])+int(student['English'])else:print("{}Information does not exist".format(Name))else:print("There is an error in your input, please re-enter.")

to sum up

1、 The code framework is concise and clear, and adding functions only needs to be added in the main loop.
2、 Super basic, don't spray if you don't like it.

Recommended Posts

Python realizes the development of student management system
Implementation of python student management system
Implementing student management system with python
Python realizes business card management system
Python3 realizes business card management system
Python business card management system development
python3 realizes the function of mask drawing
What is the prospect of python development
Implementation of business card management system with python
Implementation of business card management system based on python
Detailed explanation of the implementation steps of Python interface development
Consolidate the foundation of Python (4)
Consolidate the foundation of Python(7)
Consolidate the foundation of Python(6)
Python implements parking management system
Python realizes the guessing game
Consolidate the foundation of Python(5)
Python implements car management system
Python realizes face sign-in system
Consolidate the foundation of Python (3)
The usage of wheel in python
Use of Pandas in Python development
Python implements student performance evaluation system
Python handles the 4 wheels of Chinese
Use of numpy in Python development
Python simulation of the landlord deal
Overview of the Ubuntu file system
What is the use of Python
Python realizes express price query system
Python version business card management system
Python implements the actual banking system
The premise of Python string pooling
Secrets of the new features of Python 3.8
Learning path of python crawler development
The father of Python joins Microsoft
The operation of python access hdfs
The usage of tuples in python
End the method of running python
Understanding the meaning of rb in python
Can Python implement the structure of the stack?
Learn the basics of python interactive mode
What are the required parameters of python
Logistic regression at the bottom of python
The usage of Ajax in Python3 crawler
Python solves the Tower of Hanoi game
Solve the conflict of multiple versions of python
What is the scope of python variables
Python implements the sum of fractional sequences
Python realizes batch modification of file names
Two days of learning the basics of Python
What is the id function of python
Where is the pip path of python3
The essence of Python language: Itertools library
What are the advantages of python language
The specific method of python instantiation object
Python realizes the greedy snake double battle
What is the function body of python
Quickly understand the Python development environment Spyder
The specific method of python import library
Solve the conflict of multiple versions of python
What is the function of adb in python