Consider saving all the details in a dictionary with the primary key as the name and pin & balance as secondary keys. Then, you can save it to a json file.
import json
accdict ={}
accdict['Obi'] = {'Name':'Obi Ezeakachi','Pin':1111,'Balance': 5000}
Continue for all the accounts.
with open('accounts.json','w') as f:
f.write(json.dumps(accdict))
You can now manipulate this dictionary however you want and repeat.
Also, you should call the pin checker function before making a transaction. If you’re serious about it and want it make it like an ATM, use threading to check for pin in the background while you access the details and interact with the user.
8
solved Making Bank account in Python 3