with open("data.txt", "r", encoding="utf-8") as file: text = file.read() shifted_text = "".join(chr(ord(c) + 1) for c in text) with open("output.txt", "w", encoding="utf-8") as file: file.write(shifted_text)