I am working on a project that displays my information in a txt file, it works perfectly fine with print but when I try to use write it gives me the following error:
TypeError: write() argument must be str, not dict
Here is my code:
for x in range(len(list)):
outfile = open('message.txt', 'w')
outfile.write(list[x])
outfile.close()