phthon菜鸟问题,大虾们稍微看一眼指导下,感激!
各位帮忙看下这个怎么搞的,怎么这么简单的语法都报错啊!
请帮忙解答下,感激不尽!!
Python 3.1.1rc1 (r311rc1:74436, Aug 13 2009, 23:03:31) [MSC v.1500 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> print "11"
SyntaxError: invalid syntax (<pyshell#0>, line 1)
>>> print 'ddd'
SyntaxError: invalid syntax (<pyshell#1>, line 1)
>>> print
<built-in function print>
>>> print 'dd'
SyntaxError: invalid syntax (<pyshell#3>, line 1)
>>> print 8+8
SyntaxError: invalid syntax (<pyshell#4>, line 1)
>>>
[解决办法]
python 3.0 以后print变成了函数,而不再是语句了,应该这样调用:print('ddd’)