Get the App
SLTechnology News&Howtos  ›  Development  › 

How python traverses lists and indexes

Shulou Source: shulou.com Published: 2022-06-01 04:08:36 09月22日 Update

Editor to share with you how python traverses the list and index, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

Traversing lists and indexes

# # items = 'zero one two three'.split () # method 1i = 0for item in items:print I, itemi + = searching method 2for i in range (len (items)): print I, items [I] # # recommend items =' zero one two three'.split () for I, item in enumerate (items): print I, item is all the contents of the article "how python traverses the list and Index". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Tags: Index article content recommendation not much most more knowledge industry information information channel channel reference learning help Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi MySQL Shulou Information OPPO Reno MariaDB