>>> print "hello world"
hello world
>>> "hello world"
'hello world'
>>>
有什么不同?
蟒蛇你好世界!示例主要使用:
print "hello world"
我可以把它剥掉吗print
只需使用"Hello world"
提供 Python 介绍?
不同之处在于print
calls str
而 REPL(读取评估打印循环)的默认操作是调用repr
在物体上,除非它是None
.
请注意,如果您没有在交互式解释器中工作(您不在 REPL 中),那么您将看不到any在没有的版本中输出print
.
另请注意,输出之间存在差异。repr
在字符串上添加引号。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)