在终端中使用引号的SyntaxError

问题描述 投票:-2回答:1

每次我用"编写一些代码并在终端中运行它 - 它会显示错误 - 我该如何解决?

SyntaxError: invalid syntax
Radani:Books radani$ python 2.py
  File "2.py", line 16
    Print "what is 5 - 7?", 5-7 
                         ^
SyntaxError: invalid syntax
python syntax python-2.x
1个回答
2
投票

python中的print命令都是小写的。

>>> print "what is 5 - 7?"
what is 5 - 7?
© www.soinside.com 2019 - 2024. All rights reserved.