2017-07-23 54 views
0

嗨無效字符我剛開始用python.And而我想我的第一個程序我面臨這個問題:語法錯誤:在標識符

python_mission = """ 
The mission of the Python Software Foundation is to promote, protect, 
and advance the Python programming language, and to support and 
facilitate the growth of a diverse and international community of 
Python programmer 
""" 
print(「The word returned is: {}」.format(python_mission[25:34])) 

Error: Invalid character in identifier

+1

你有捲曲的報價。 – Scimonster

+0

替換引號:'print(「返回的單詞是:{}」.format(python_mission [25:34]))'' – Shai

回答

3

通知您在打印功能的報價是多麼的不一個普通的雙引號,但是是一個有角度的...當你的macOS的設置被設置爲它們的缺省值以使用它們時獲得的類型。

您需要的報價是定期的,所以......

print(「The word returned is: {}」.format(python_mission[25:34])) 

應該是...

print("The word returned is: {}".format(python_mission[25:34])) 

您也可以取消選中「使用智能引號和破折號」,以避免這種在未來:
enter image description here

相關問題