Course of Raku / Advanced / Operators / Types of Raku operators / Exercises / Boolean of a value
Solution: Boolean of a value
Here is a possible solution to the task.
Code
say ?0;
say ?5;🦋 You can find the source code in the file boolean-of-a-value.raku.
Output
False
TrueComments
?is a prefix operator: it comes before its operand and returns the operand’s Boolean value.0is false and5is true, so the program printsFalseandTrue.