python print不换行
Python2.x版本print x, 或者
print (),
Python 3.x版本
print(x,end=' ')
print(*objects, sep=' ', end='\n', file=sys.stdout, flush=False)
这是 print() 的原型。默认是以 \n 结尾,即换行。把 \n 换掉就行
比如我的2.7.10版本
[*]def function(a,b):
[*] sums=a+b
[*] print ('sums='),
[*] print(sums)
[*]>>> function(3,4)
[*]sums= 7
页:
[1]