0

I am starting to learn to program with Python in Sublime Text, so I am taking a course on YouTube. In one part he teaches this example to learn "if" and "else":

print ("Access verification")

user_age = int (input ("Please enter your age"))

if user_age <18:
   print ("You can't pass")
elif user_age> 100:
   print ("Incorrect age")
else:
   print ("You can pass")

print ("The program has ended")

But when I run the program (Tools> SublimeREPL> Python> RUN current file) I get this error:

File "conditionals2.py", line 1
SyntaxError: Non-ASCII character '\ xc3' in file conditionals2.py on line 1, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details

*** Repl Closed *** This error only happens to me on Mac, if I run the exact same file on Windows it works. I already tried uninstalling and installing REPL but nothing happened

6
  • Please post properly formatted code. This is especially important for Python due its indentation rules Commented Dec 21, 2021 at 17:31
  • Is it possible that you use python2 instead of python3? Commented Dec 21, 2021 at 17:40
  • Is the line print ("Access verification") the line 1 in conditionals2.py? Commented Dec 21, 2021 at 17:40
  • Does this answer your question? Python NLTK: SyntaxError: Non-ASCII character '\xc3' in file (Sentiment Analysis -NLP) Commented Dec 21, 2021 at 17:41
  • Remove all the spaces between print, int, input and their parentheses Commented Dec 21, 2021 at 17:46

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.