Try it on paper first. A hint, the key idea and the worked solution are here when you need them.
Use sep to show 2026-10-11. Then use end so that Hello and world are on the same line.
sep goes between the pieces, and end goes after the text.
Have you tried it?
Work it out on paper first. It is fine to get stuck or make a mistake: that is how we learn. When you are ready, go through the solution one step at a time, and check each step against your own.
First part. print("2026", "10", "11", sep="-") puts a hyphen between the pieces.
Second part. print("Hello", end=" ") shows Hello and then a space, not a new line. The next print("world") continues on the same line.
Check. The output is 2026-10-11, then Hello world.
Log in to join the discussion.
Loading…