Course of Raku / Objects, I/O, and exceptions / Input and output / Working with files / Appending to a file

Quiz — spurt and slurp

What does the following program print?

spurt 'f.txt', "A\n";
spurt 'f.txt', "B\n";

print slurp 'f.txt';
0A
1B
0A and B on two lines
0nothing

Course navigation

Appending to a file   |   Save and read