在老的Python版本中 例如2.5版本使用print输出可以写成:
>>>print "Hello world!"
但是在新的版本 上面的写法将报系统错误:
SyntaxError: Missing parentheses in call to 'print'
原因是在新的版本 输出有了新的变化。
当写成下面语句的时候将不会报错.
>>> print("Hello,world!")
Hello,world!
在老的Python版本中 例如2.5版本使用print输出可以写成:
>>>print "Hello world!"
但是在新的版本 上面的写法将报系统错误:
SyntaxError: Missing parentheses in call to 'print'
原因是在新的版本 输出有了新的变化。
当写成下面语句的时候将不会报错.
>>> print("Hello,world!")
Hello,world!