def getList(self):
     global studentList
     studentList.clear()
     try:
         with open(connectionString, "r") as studentListFile:
             studentListFromFile = dict(json.load(studentListFile))
             for studentId, studentInfo in studentListFromFile.items():
                 currentInsertedStudent = json.loads(studentInfo)
                 currentStudent = Student()
                 currentStudent.setStudentId(
                     currentInsertedStudent["studentId"])
                 currentStudent.setName(currentInsertedStudent["name"])
                 currentStudent.setEmail(currentInsertedStudent["email"])
                 currentStudent.setAddress(
                     currentInsertedStudent["address"])
                 currentStudent.setContactNumber(
                     currentInsertedStudent["contactNumber"])
                 currentStudent.setPassword(
                     currentInsertedStudent["password"])
                 studentList[currentStudent.getStudentId(
                 )] = currentStudent.toJson()
                 # result = 1 / 0
             if studentList.items() == 0:
                 raise ValueError(
                     "Dosya içerisinde herhangi kayıt bulunamadı.")
             return studentList
     except FileNotFoundError as fileNotFoundError:
         return fileNotFoundError
     except ValueError as valueError:
         return valueError
     except ZeroDivisionError as zeroDivisionError:
         return zeroDivisionError
     except Exception as ex:
         return ex
 def update(self, student):
     global studentList
     for studentId, studentInfo in studentList.items():
         if studentId == student.getStudentId():
             currentStudent = Student()
             currentStudent.setStudentId(student.getStudentId())
             currentStudent.setName(student.getName())
             currentStudent.setPassword(student.getPassword())
             currentStudent.setContactNumber(student.getContactNumber())
             currentStudent.setEmail(student.getEmail())
             currentStudent.setAddress(student.getAddress())
             studentList[
                 currentStudent.getStudentId()] = currentStudent.toJson()
             with open(connectionString, "w") as studentListFile:
                 json.dump(studentList, studentListFile)
             return True
     return False