Python programs are basically text files. Usually people write them using only characters from the ASCII character set, and therefore, they don’t need to think about the encoding they write to: all character sets agree on how to decode ASCII characters.
You wrote a Python program using a non-ASCII character. So your program has implicit encoding (which you did not mention): to save such a file, you need to decide how you are going to represent a-umlaut on disk. I would suggest that perhaps your editor chose something non-Unicode for you.
In any case, there are two possibilities for such a problem: either you can limit yourself to using only ASCII characters in the source code of your program, or you can declare to Python that you want it to read a text file with a specific encoding.
To do the first, you must replace a-umlaut with your Unicode escape sequence (which, it seems to me, is \x0228 , but cannot check at the moment). To do the latter, you must add an encoding declaration at the top of the file:
source share