In Python, we are accustomed to traverse this way:
650) this.width=650; "src=" Http://www.cnblogs.com/Images/OutliningIndicators/None.gif "align=" Top "/> for Item in sequence:
650) this.width=650; "src=" Http://www.cnblogs.com/Images/OutliningIndicators/None.gif "align=" Top "/> Print (item)
This iterates through the item's ordinal I, all with the following traversal method:
650) this.width=650; "src=" Http://www.cnblogs.com/Images/OutliningIndicators/None.gif "align=" Top "/> for index in range (len (sequence)):
650) this.width=650; "src=" Http://www.cnblogs.com/Images/OutliningIndicators/None.gif "align=" Top "/> Print ( Sequence[index])
In fact, if you understand the built-in enumerate function, you can also write this:
650) this.width=650; "src=" Http://www.cnblogs.com/Images/OutliningIndicators/None.gif "align=" Top "/> for Index, item in Enumerate (sequence):
650) this.width=650; "src=" Http://www.cnblogs.com/Images/OutliningIndicators/None.gif "align=" Top "/> Print ( Index, item)
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/80/29/wKiom1c5i_3RYOvNAAAey-R8Fvk565.png "title=" QQ picture 20160515184728.png "alt=" Wkiom1c5i_3ryovnaaaey-r8fvk565.png "/>
Enumerate function usage in Python