First Exposure: Python Iterators
Let's start by making a list of cookie types, converting it into an iterator, and entering it into our Coconut interpreter:
cookiebox = iter(["chocolate chip", "oatmeal raisin", "sugar"])
This is how to take an iterable object, such as a list, and turn it into an iterator in Python. As we see, this, and the other basic iterator functionality from Python remains the same. Try entering the following command into the interpreter a few times to iterate through the cookiebox.
Now let's try combining this with Coconut's syntax. Let's start by defining x as the following iterator: