Course of Raku / Advanced / Containers / Scalar containers / Exercises

Integers only

Problem

Declare a container $cars that is allowed to hold integers only.

You are given a value that was obtained via traffic modelling computations: 250.7. Store it in $cars, converting it to an integer so that the assignment is accepted. Then print the value and its type.

Example

The program prints:

250
(Int)

Solution

See the solution

Course navigation

Solution: Default discount   |   Solution: Integers only