Course of Raku / Objects, I/O, and exceptions / Exceptions / Catching exceptions with try / Exercises

When nothing goes wrong

Problem

Use a try block that computes 21 * 2 and does not fail. Print whether the result is defined, and then print the result itself.

Example

The program prints:

True
42

Solution

See the solution

Course navigation

Solution: Catch the error   |   Solution: When nothing goes wrong