for i in x:
print(i, end="") # substitute the null-string in place of newline
会给你
......
在 您可以通过以下方式使用该print()
函数:
from __future__ import print_function
作为源文件中的 第一条 语句。
Old: print x, # Trailing comma suppresses newline
New: print(x, end=" ") # Appends a space instead of a newline
请注意,这类似于我最近回答的问题http://codingdict.com/questions/193853),其中包含一些有关此print()
功能的其他信息(如果您感到好奇)。