Okay so what I'm looking to do is output a set to a file in python. I have one file, it contains random strings. I first open the text file and read to check if any duplicates are seen, once finished I want to output the set back to the file.
Here's what I got
sets = set()
file1 = open("file1.txt", "r+")
for line in file1:
sets.add(line)
file1.write(sets)
It says that write only takes the argument str and not set. Anyone know how to get around this?
Help would be appreciated.