Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def editStudentRecord(): #Menu option 2 - Edit existing student info
- checkForStudent = (input("Enter the student number: (FORMAT-S0000) >"))
- if checkForStudent in STUDENT_INFO_DICTIONARY.keys():
- print("Records for student: ", checkForStudent , " available.")
- print(STUDENT_INFO_DICTIONARY[checkForStudent])
- while True: #Gather student information from the user
- tempForename = input("Enter students forename: >")
- tempSurname = input("Enter students surname: >")
- while True:
- print("NOTE: Information entered as a number between 0.0 and 100.0 ONLY!!")
- tempMark1 = float(input("Enter students Mark for Assessment 1: >"))
- tempMark2 = float(input("Enter students Mark for Assessment 2: >"))
- tempMark3 = float(input("Enter students Mark for Assessment 3: >"))
- tempAverage = ((tempMark1 + tempMark2 + tempMark3)/3)
- if (tempMark1 >= 0 and tempMark1 <= 100 and tempMark2 >= 0 and tempMark2 <= 100 and tempMark3 >= 0 and tempMark3 <= 100):
- break
- else:
- print("Invalid marking information! Please re-enter correctly.")
- print("Information entered for new student: Forename-",tempForename," Surname-",tempSurname," Assessment 1-",tempMark1," Assessment 2-",tempMark2," Assessment 3- ",tempMark3," Average -",tempAverage,"%")
- confirmInfo = input("Please confirm information is correct (Y/N): >").upper()
- if (confirmInfo == "Y"):
- STUDENT_INFO_DICTIONARY[checkForStudent] = {(tempForename, tempSurname, str(tempMark1), str(tempMark2), str(tempMark3), str(tempAverage),"%")}
- print("Information on the student has been stored! Press enter to return to main menu.")
- return False
- elif (confirmInfo == "N"):
- print("Please re-enter information correctly.")
- else:
- print("Invalid option! Please re-enter information correctly")
- else:
- print("Student NOT on system! Press enter to return to main menu.")
- input()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement