""" crypto2.py - - get word from file 'input.txt' - change each letter to one higher - put word into file 'output.txt (I created the file input.txt with the jupyter text editor and put the word 'cat' into it.) jim@jupyter:~$ ls 2020-01 backups crypto.py input.txt unix_shell_stuff 2020-09 circles.ipynb drawing output.txt 2021-02 crypto2.py drawing.py __pycache__ jim@jupyter:~$ cat input.txt cat jim@jupyter:~$ python crypto2.py jim@jupyter:~$ cat output.txt dbujim@jupyter:~$ Notice that in this version, the output file doesn't have a newline at the end, which is why it printed as "dbujim...". To put a newline in, we could have added output.write("\n") after writing the word. """ def main(): input = open("input.txt") # input data = input.read() # get whole file word = data.strip() # remove whitespace newlines new_word = "" # do stuff for letter in word: # . new_word = new_word + chr(ord(letter) + 1) # . output = open("output.txt", "w") # open for writing - make or replace file output.write(new_word) # put stuff into it main()