python中print不换行

python中print()语法默认会自动换行,实际上print()默认应该为print(x,end=' ')

所以想要不换行只要改变end的值就行了比如 print(x,end = ',')

print('hello')
print('python')
hello
python

print('hello', end=',')
print('python')
hello,python
原文地址:https://www.cnblogs.com/vevy/p/9122351.html