使用Python的print()
函数中的sep
、file
等参数时,我遇到了奇怪的错误。
我尝试通过谷歌搜索、在Stack Overflow上查找并阅读Python文档,但都没有找到解决方法。
我附上了一个简单的代码片段,非常感谢任何帮助。
# python
Python 2.7.2 (default, Aug 19 2011, 20:41:43) [GCC] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> print("blah"*10, sep=" | ")
File "<stdin>", line 1
print("blah"*10, sep=" | ")
^
SyntaxError: invalid syntax
print()
函数的相关文档吗? - Mr.