Implementing Iterator pattern of a single Linked List |  ; Creating a list ; Elements to be added at the end . in the above created list . ; Elements of list are retrieved through iterator .
if __name__ == ' _ _ main _ _ ' : NEW_LINE INDENT list = [ ] NEW_LINE list . append ( 1 ) NEW_LINE list . append ( 2 ) NEW_LINE list . append ( 3 ) NEW_LINE for it in list : NEW_LINE INDENT print ( it , end = ' ▁ ' ) NEW_LINE DEDENT DEDENT