首页 > 其他 > 详细

[error]

时间:2017-01-23 22:31:26      阅读:259      评论:0      收藏:0      [点我收藏+]

1、

输入:>>>print"hha"
SyntaxError: invalid syntax  

原因:要写空格

 

2、
>>> print "hello"
SyntaxError: Missing parentheses in call to ‘print‘

原因:Mac安装俩个Python版本,2和3,python2系列可以支持 print “xxxx” ,python系列需要使用print("xxx")

解决:
>>> print("hello")
hello

 

3、

>>> a=‘123‘
>>> print(‘1‘)
1
>>> print(‘1‘) in a
1
Traceback (most recent call last):
File "<pyshell#52>", line 1, in <module>
print(‘1‘) in a
TypeError: ‘in <string>‘ requires string as left operand, not NoneType

[error]

原文:http://www.cnblogs.com/amanon/p/6344950.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!