Simple code upload
This commit is contained in:
10
script.py
Normal file
10
script.py
Normal file
@ -0,0 +1,10 @@
|
||||
# Read the file
|
||||
with open("input.txt", "r", encoding="utf-8") as file:
|
||||
lines = file.readlines()
|
||||
|
||||
# Remove duplicates by converting to a set, then back to list to keep the order
|
||||
unique_lines = set(lines)
|
||||
|
||||
# Write the unique lines back to the file or a new file
|
||||
with open("output.txt", "w", encoding="utf-8") as file:
|
||||
file.writelines(unique_lines)
|
Reference in New Issue
Block a user