abstract data types the implementation of this operation until the next section where we discuss the creation and use of iterators in python list stores references to objects and technically would be illustrated as shown in the figure to the right to conserve space and reduce the clutter that can result in some figureshoweverwe illustrate objects in the text as boxes with rounded edges and show them stored directly bag within the list structure variables theitems will be illustrated as square boxes bag with bullet in the middle and the name of the variable printed nearby bag iterators traversals are very common operationsespecially on containers traversal iterates over the entire collectionproviding access to each individual element traversals can be used for number of operationsincluding searching for specific item or printing an entire collection python' container types--stringstupleslistsand dictionaries--can be traversed using the for loop construct for our user-defined abstract data typeswe can add methods that perform specific traversal operations when necessary for exampleif we wanted to save every item contained in bag to text filewe could add saveelements(method that traverses over the vector and writes each value to file but this would limit the format of the resulting text file to that specified in the new method in addition to saving the itemsperhaps we would like to simply print the items to the screen in specific way to perform the latterwe would have to add yet another operation to our adt not all abstract data types should provide traversal operationbut it is appropriate for most container types thuswe need way to allow generic traversals to be performed one way would be to provide the user with access to the underlying data structure used to implement the adt but this would violate the abstraction principle and defeat the purpose of defining new abstract data types pythonlike many of today' object-oriented languagesprovides built-in iterator construct that can be used to perform traversals on user-defined adts an iterator is an object that provides mechanism for performing generic traversals through container without having to expose the underlying implementation iterators are used with python' for loop construct to provide traversal mechanism for both built-in and user-defined containers consider the code segment from the checkdates py program in section that uses the for loop to traverse the collection of datesiterate over the bag and check the ages for date in bag if date <bornbefore print"is at least years of age"date