iterable object pytohn 1

iterable object pytohn

Iterable objects, such as strings, lists, and tuples.

Here is what the above code is Doing:
1. The first line creates a generator object.
2. The second line iterates over the generator object, and prints each value.
3. The third line iterates over the generator object again, and prints each value.

Notice that the generator object is created only once, but it can be iterated over multiple times.

Similar Posts