Hi there, welcome to the forums!
In future, if you’re asking a question about a particular exercise or project, it’s really helpful if you also provide a link to the project in question. (It would have saved me the 10 minutes I spent trying to find it in the Catalog! )
You’re getting an error because I think you’re running the script with
python, which would mean you’re using Python 2. You can verify this by running
python --version in the bash terminal in the learning environment, like so:
In Python 2, strings are ASCII by default. If you want to use a non-ASCII character, like
ã, you need to tell Python to expect it in some way.
The easiest way to do this is by telling Python what encoding you’re using. On the very first line of your “script.py”, you can copy and paste the following:
# coding: utf-8
Your program will run fine then with the
ã character, because we’ve told Python to default to using UTF-8 which includes a codepoint for that character.
In the lesson instructions, though, #26 does say to run
It’s possible you’ve just made a typo, and run
python script.py instead of
Python 3 uses unicode by default, so you wouldn’t get that error.