kovachev-bot/bulgarian-anagrams/reformat.py
2023-09-01 18:12:08 +01:00

12 lines
282 B
Python

def process(line: str) -> str:
return line[line.rfind(" ")+1:].replace("-", "")
with open("words.txt") as f:
contents = f.readlines()
for i, line in enumerate(contents):
contents[i] = process(line)
with open("modified.txt", mode="w") as f:
f.writelines(contents)