คุณสามารถรวมหลายคำสั่ง print ต่อบรรทัดได้โดยใช้ , ใน Python 2 และใช้อาร์กิวเมนต์ end ของฟังก์ชัน print ใน Python 3
ตัวอย่าง
Python 2.x
print "Hello",
print " world"
Python 3.x
print("Hello", end='')
print(" world")
ผลลัพธ์
Hello world
อีกวิธีหนึ่งคือใส่ทุกอย่างในอาร์เรย์และเรียก ' '.join(array)
ตัวอย่าง
arr = ["Hello", "world"]
print(' '.join(arr))
ผลลัพธ์
Hello world