I tried to modify my text de-duplication program, which removes duplicate lines from a text file, to remove whitespace before considering whether a line is a duplicate. I used .strip() to do this. Before adding .strip(), the program was missing some duplicate lines. After adding .strip(), it deleted every line! What went wrong?
Hi Artyom,
I tried to modify my text de-duplication program, which removes duplicate lines from a text file, to remove whitespace before considering whether a line is a duplicate. I used .strip() to do this. Before adding .strip(), the program was missing some duplicate lines. After adding .strip(), it deleted every line! What went wrong?
Thanks, Ryan textdeduplicator.txt