So i want to doing college project to build some sort of bank application, the input from the user should saved to the dictionary in txt file, but i only know how to do dict in python not the txt file How should i code this?
my code is something like this
rekening = {
}
a=input("Masukkan Nama Anda : ")
x = [i for i in range(1, 10)]
norek = (random.choice(x), random.choice(x), random.choice(x))
norekakhir = int(''.join(map(str, norek)))
rekening[a] = "rek" + str(norekakhir)
print("Rekening anda dengan nama", a, "Nomer Rekening", "rek" + str(norekakhir))
print("Telah terdaftar")
print("Terima Kasih")
print(rekening)
it only save to the dictionary not to txt file, sorry for my broken english and its my first time post here ^^