Our first program will demonstrate iterating over elements in a variety of built-in data structures using for. Let’s see how to use iteration with some of the data structures we’ve already learned.
To run the program, save the code in a file named range-over-built-in-types.rkt and then use the Racket interpreter to execute it.
We’ve seen how to iterate over lists, hash tables, and strings in Racket. Now, let’s explore more about the language.