Course of Raku / Objects, I/O, and exceptions / Input and output / Standard streams / Exercises / Print without a newline

Solution: Print without a newline

Here is a possible solution to the task.

Code

$*OUT.print('a');
$*OUT.print('b');
$*OUT.say('c');

🦋 You can find the source code in the file print-without-newline.raku.

Output

abc

Comments

  1. $*OUT.print writes its text without adding a newline, so a and b stay on the same line.

  2. $*OUT.say writes c and then a newline, finishing the line abc.

Course navigation

Print without a newline   |   Quiz — Standard streams