How to print without a space
This question already has an answer here:
这对你有用吗?
import sys
sys.stdout.write(item)
Before the wonderful end=
(and sep=
) appeared in Python 3, I used to build up lines within strings and the print out the string in one hit:
str = "Three integers:"
for iii in range (3):
str = "%s %d" % (str, iii)
print s
Needless to say, I don't code in Python 2 any more :-)
链接地址: http://www.djcxy.com/p/77224.html上一篇: Python中奇怪的换行符错误
下一篇: 如何在没有空间的情况下打印