I'm making a program that saves user data into a text file. Currently I'm using a dictionary to be referenced throughout the entire program, and when the user quits the program, it takes all the data from the dictionary and writes it into the text file. While I have most of the program working, I'm having a bit of trouble writing the actual end data into the text file. If you could help me, I would appreciate it alot!
I'm also quite new to programming as a whole so sorry if any of my coding habits are bad.
lis = []
for new_k, new_v in dictionary.items():
lis.append([new_k, new_v])
output = (" ".join(map(str, lis)))
acc = open("Storage.txt", "w")
acc.write(lis)