print(*objects, sep=' ', end='\n', file=sys.stdout, flush=False)
这是 print() 的原型。默认是以 \n 结尾,即换行。把 \n 换掉就行。
python 2.x, print 不换行
>>> print x,
python 3.x print 不换行
>>> print(x, end="")
print(*objects, sep=' ', end='\n', file=sys.stdout, flush=False)
这是 print() 的原型。默认是以 \n 结尾,即换行。把 \n 换掉就行。
python 2.x, print 不换行
>>> print x,
python 3.x print 不换行
>>> print(x, end="")