3

Newbie disclaimer: I am new to Python and just started using IDLE to play around with Python.

My problem is the interpreter does not recognize strings, whether enclosed in ¨¨ or ´´.

I configured IDLE to use UTF-8. but it does not seem to be an IDLE issue. What I tried is to test this string in the interpreter directly. It does not work.

print ¨Money¨

to the interpereter returns

File "<stdin>", line 1 print ¨Money¨ ^ SyntaxError: invalid syntax

Can someone help me with this? I am using a new laptop running fedora15 with the international keyboard layout and python version is 2.7.1.

2
  • 1
    Well if it was Python 3, I'd say put parentheses around the string, but not sure why 2 isn't handling it. Commented Oct 1, 2011 at 6:08
  • 3
    Those quote characters don't look right. Retype them in your interpreter, using the keyboard. Commented Oct 1, 2011 at 6:10

2 Answers 2

7

You need to use "" or '', not ¨¨, ´´ or any other fancy characters.

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

2 Comments

+1 for answering first while I was looking up the actual characters with a hex dump. The OP was using U+00A8 DIAERESIS and U+00B4 ACUTE ACCENT.
ok. I got the problem. On this brand new QWERTY laptop keyboard with US international layout that i use,attempting to type the double quote on the keyboard with just Shift key gives me ¨¨, the DIARESIS you have specified. Shift+Alt+double quotes gives me the right character. thanks to all of you.
0

Just switch your keyboard setting between normal US English for coding, and US English International for texting, that worked for me.

Comments

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.