python中print()语法默认会自动换行,实际上print()默认应该为print(x,end=' ')
所以想要不换行只要改变end的值就行了比如 print(x,end = ',')
print('hello')
print('python')
hello
python
print('hello', end=',')
print('python')
hello,python
python中print()语法默认会自动换行,实际上print()默认应该为print(x,end=' ')
所以想要不换行只要改变end的值就行了比如 print(x,end = ',')
print('hello')
print('python')
hello
python
print('hello', end=',')
print('python')
hello,python