How to print 2 items on the same line
This question already has an answer here:
Separate the values with a comma:
print 'Your new balance:', new
See a demonstration below:
>>> new = 123
>>> print 'Your new balance:', new
Your new balance: 123
>>>
>>> print 'a', 'b', 'c', 'd'
a b c d
>>>
Note that doing so automatically places a space between the values.
链接地址: http://www.djcxy.com/p/77210.html上一篇: 在python中不添加控制字符的打印方法
下一篇: 如何在同一行上打印2个项目