-2

the program is below,and the error i get is this

File "python2.py", line 1 SyntaxError: Non-ASCII character '\xe2' in file python2.py on line 1, but no encoding declared.

I am running python on macosx.

print "hello world"
print “Enter your name:”
nameEntered = raw_input()
print “Enter your Age:”
usrAge = raw_input()
nusrAge = int(usrAge)

if nusrAge <10:
    print “you are very young”
if nusrAge <20:
    print “you are a teen”
if nusrAge >70:
    print “you are pretty old”
if nusrAge == 13:
    print “you just began your teen years:”
print “Goodbye”
wwii
  • 23,232
  • 7
  • 37
  • 77
  • 1
    possible duplicate of [Python "SyntaxError: Non-ASCII character '\xe2' in file"](http://stackoverflow.com/questions/21639275/python-syntaxerror-non-ascii-character-xe2-in-file) – Loocid May 29 '15 at 02:12

1 Answers1

2

Your text editor is putting curly quotes into your program. You need to switch it to plain text.

Ewan Mellor
  • 6,747
  • 1
  • 24
  • 39