Course of Raku / Objects, I/O, and exceptions / Input and output / File handles
Quiz — Reading lines
A file n.txt contains three lines. How many times does
the body of this loop run?
for 'n.txt'.IO.lines -> $line {
say $line;
}| 0 | 1 |
| 1 | 3 |
| 0 | 0 |
| 0 | once for each character |
Course navigation
← Solution: Pass a handle to a function | Running external programs 🆕 →