We need a way of saving in a file the object of PersonalBank. A way of doing that is by using the JSON format (example).
Achieving that is not obvious since the default encoder of Python's json module is not able to serialize that kind of objects. Therefore, the default encoder must be extended as stated in the official documentation for the json module here.
Bellow follows an example of a PersonalBank object JSON serialization:
We need a way of saving in a file the object of PersonalBank. A way of doing that is by using the JSON format (example).
Achieving that is not obvious since the default encoder of Python's json module is not able to serialize that kind of objects. Therefore, the default encoder must be extended as stated in the official documentation for the json module here.
Bellow follows an example of a PersonalBank object JSON serialization: