Python3的print怎么让它不换行

如何让print不换行

在Python中总是默认换行

 

for y in range(0,10):
    print(y)

 结果:

0
1
2
3
4
5
6
7
8
9

 如果想要不换行,在3.x 中应该写成 print(x, end ="")

for y in range(0,10):
    print(y, end="")

结果:

0123456789

 

猜你喜欢

转载自www.cnblogs.com/orangeJJJ/p/10124094.html