Code :
# Storing student informationstudent = list()# Display a menudef showMenu():print("1. Add student information ")print("2. Delete student information ")print("3. Modify student information ")print("4. Show student information ")print("0. Exit the system ")select = eval(input(" operation :"))return select# Add student informationdef addStudent():print("----- Add student information -----")name = input(" full name :")sex = input(" Gender :")age = input(" Age :")phone = input(" Telephone :")student.append({"name":name,"sex":sex,"age":age,"phone":phone})print(" Add success !")# Show student informationdef showStudent():if len(student) == 0:print(" The current student information is empty !")else:print("----------- Student information ------------")print(" Serial number \t full name \t Gender \t Age \t Telephone ")for i in range(0,len(student)):print("%d\t%s\t%s\t%s\t%s"%(i+1,student[i].get('name'),student[i].get('sex'),student[i].get('age'),student[i].get('phone')))print("------------------------------")# Delete student informationdef delStudent():print("--- Deleting operation in progress ---")print("----- Current student information ------")showStudent()select = eval(input(" Please input the student serial number to delete :"))del student[select-1]print(" Delete successful !")# Modify student informationdef reviseStudent():studict = {1: "name", 2: "sex", 3: "age", 4: "phone"}print("----- Modification in progress -----")showStudent()num = eval(input(" Please input the student serial number to be modified :"))print("1- Change the name \n2- Change gender \n3- Change the age \n4- Change the phone number ")revisenum = eval(input(" Please input the serial number of the information to be modified :"))newstr = input(" Please enter new information :")student[num-1][studict[revisenum]] = newstrprint(" Modification successful !")# Main running functiondef init():while True:# Show student informationshowStudent()# Show menuselect = showMenu()if select == 1:addStudent()elif select == 2:delStudent()elif select == 3:reviseStudent()elif select == 4:showStudent()elif select == 0:# Exit the systembreakelse:print(" Incorrect input ! Please do it again !")continue
1. Add student information

2. Delete student information

3. Modify student information

4. Show student information
( More source code 、 Information 、 Courseware 、 Error reporting solutions can be obtained by scanning below )
