為什么會出錯的?
L = range(1, 101)
print L[:10]
print L[2::3]
print L[4:51:5]
? File "index.py", line 3
SyntaxError: Non-ASCII character '\xef' in file index.py on line 3, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
L = range(1, 101)
print L[:10]
print L[2::3]
print L[4:51:5]
? File "index.py", line 3
SyntaxError: Non-ASCII character '\xef' in file index.py on line 3, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
2019-06-12
舉報
2019-06-16
python是英文編寫的,符號需要英文符號
2019-06-13
冒號要用英文標點字符
就可以正常運行了
2019-06-12
需要使用英文狀態下的符號。