python3中输出不换行

python2中输出默认是换行的,为了抑制换行,是这么做的:

print x,

到了python3中,print变成一个函数,这种语法便行不通了。用2to3工具转换了下,变成这样了:

print(x, end=' ')

原文地址:https://www.cnblogs.com/hustxujinkang/p/4616493.html