- Mastering Python Scripting for System Administrators
- Ganesh Sanjiv Naik
- 74字
- 2021-07-02 14:00:23
Indexing, slicing, and matrices
List indices work the same way as string indices. Values can be accessed using index. If you try to read or write an element that does not exist, you get IndexError. If an index has a negative value, it counts backward from the end of the list.
Now, we will create a list named cities and we will see the index operations:
cities = ['Mumbai', 'Bangalore', 'Chennai', 'Pune']

推薦閱讀
- JavaScript前端開發模塊化教程
- Oracle 11g從入門到精通(第2版) (軟件開發視頻大講堂)
- Objective-C應用開發全程實錄
- MySQL 8 DBA基礎教程
- Groovy for Domain:specific Languages(Second Edition)
- Apache Mahout Clustering Designs
- 精通Python自動化編程
- 基于Struts、Hibernate、Spring架構的Web應用開發
- C/C++程序員面試指南
- Statistical Application Development with R and Python(Second Edition)
- 3ds Max印象 電視欄目包裝動畫與特效制作
- Java EE 7 with GlassFish 4 Application Server
- Puppet:Mastering Infrastructure Automation
- Python面試通關寶典
- Android初級應用開發