在Python 3中,如果你想让`print`函数不换行,你可以通过设置`end`参数为空字符串`''`来实现。下面是一个例子:
print('Hello, World!', end='')
print('This line will be on the same line as the previous one.')
输出结果将会是:
Hello, World!This line will be on the same line as the previous one.
这样,你就可以避免`print`函数在输出内容后自动换行