Iterators vs. Iterables
Let's do a quick recall of what you've learned about iterables and iterators. Recall from the video that an iterable is an object that can return an iterator, while an iterator is an object that keeps state and produces the next value when you call next() on it. In this exercise, you will identify which object is an iterable and which is an iterator.
The environment has been pre-loaded with the variables flash1 and flash2. Try printing out their values with print() and next() to figure out which is an iterable and which is an iterator.
Latihan ini adalah bagian dari kursus
Python Toolbox
Latihan interaktif praktis
Ubah teori menjadi tindakan dengan salah satu latihan interaktif kami.
Mulai berolahraga