Comparing phone numbers across CSVs Python
Here's my 5 cents as non-python guy
Naming:
As soon as you begin numbering variable names, there should be alarm bells ringing... multiple loud alarm bells.
rename your out, out2, and the corresponding writers. Instead use descriptive names (maybe similar to your &quot;filenames&quot;): first_list, second_list, and so on. The same applies for your writers.
Also seen2 is not a good name.. What do you store in that variable? Name it after that: second_seen is definitely better, than seen2