0

I am seeing the following error:

SyntaxError: Non-ASCII character '\x93' in file new2.py on line 2, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details

when I run this code:

print(“Welcome")
 guess = 0
 while guess != 5:
    g = input(“Guess the number: ")
    guess = int(g)
    if guess == 5:
    print(“You win!")
    else:
    if guess > 5:
    print(“Too high")
    else:
    print(“Too low")
print(“Game over!")
2
  • 1
    What symbol is supposed to be? On the line g = input(“Guess the number: ") - same in your print statements Commented Mar 17, 2017 at 13:14
  • 3
    Your endquote is correct " but your opening quotes are both smart quotes, which aren't ascii. Did you copy & paste this from some other application, that may be the cause of your errors. Commented Mar 17, 2017 at 13:16

1 Answer 1

3

You need to use proper double quotes, not the sign, which is not ASCII.

Sign up to request clarification or add additional context in comments.

1 Comment

It's mentioned in comments but these are also known as "smart quotes". Almost always the problem created by code biting from a website.

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.