Python print 输出不换行

*Python 版本 2.7 *

方法一

print "123",
print "456"

优点:方便
缺点:中间有间隔

方法二

#文件首行或第二行
1:from __future__ import print_function
print('123123', end='')

相关文章:

  • 2022-12-23
  • 2022-01-22
  • 2022-12-23
  • 2022-12-23
  • 2021-12-26
  • 2021-10-25
  • 2021-07-26
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-06-28
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-09
相关资源
相似解决方案