← back to unit
Easy
# basics io
Changing the Ending
After print() finishes, it normally moves to a new line — that's because it secretly ends every message with \n (a line break). You can change that with end=:
print("Hi, ", end="")
print("there!")
Because the first print() doesn't add a line break, both messages land on the same line: Hi, there!
Your turn: using two separate print() calls, make the screen show Hello, World! all on one line — the first call should print Hello, with end="", and the second should print World!
💡 need a hint?
pyb-io-print-end.py
loading...