- Mastering Python Scripting for System Administrators
- Ganesh Sanjiv Naik
- 74字
- 2021-07-02 14:00:25
Indexing, slicing, and matrices
Tuple indices work the same way as list 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 tuple named cities and perform some index operations:
cities = ('Mumbai', 'Bangalore', 'Chennai', 'Pune')

推薦閱讀
- HornetQ Messaging Developer’s Guide
- Mastering AWS Lambda
- Beginning C++ Game Programming
- Visual C++實(shí)例精通
- Hands-On JavaScript High Performance
- INSTANT CakePHP Starter
- The Computer Vision Workshop
- 基于Swift語(yǔ)言的iOS App 商業(yè)實(shí)戰(zhàn)教程
- Learning jQuery(Fourth Edition)
- Building Wireless Sensor Networks Using Arduino
- Spring技術(shù)內(nèi)幕:深入解析Spring架構(gòu)與設(shè)計(jì)原理(第2版)
- C++程序設(shè)計(jì)教程(第2版)
- HTML5 WebSocket權(quán)威指南
- 你好!Java
- Zend Framework 2 Cookbook