And you create a range() object as shown below and use the index i to access the item at position i in each of the iterables. You know that all the lists – list_1, list_2., list_N – contain the same number of items. "If I know that all lists have the same number of items, can I not just use the index to tap into each of those lists, and pull out the item at the specified index?" You may think of using the range() object with the for loop. Why Using Python's range() Object is Not an Optimal Choice Always This is precisely what is called parallel iteration. We need to be able to access items at a particular index from both the lists.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |