Puzzle 24 | Home on the Range |
| fn main() { |
| .. .. ..; |
| } |
Guess the Output | |
---|---|
Try to guess what the output is before moving to the next page. |
The program will compile and run, but it won’t display any output.
Discussion
The .. symbol has a few meanings in Rust:
-
.. without numbers indicates a range containing every available value.
-
1..3 creates a range that starts at 1 and stops at 2.
-
1.. creates a range that starts at 1 and continues ...
Get Rust Brain Teasers now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.