官术网_书友最值得收藏!

Dereferencing a single element

If you want to dereference a single element of the list you can just use the bracket like that:

y[1]

The output of the above code is as follows:

11

So y[1] will return element 1. Remember that y had 10, 11, 12 in it - observe the previous example, and we start counting from 0, so element 1 will actually be the second element in the list, or the number 11 in this case, alright?

主站蜘蛛池模板: 舟山市| 体育| 高青县| 津市市| 沙田区| 且末县| 桃园县| 金湖县| 寿光市| 桐柏县| 星子县| 浮山县| 苏州市| 方山县| 雅安市| 叙永县| 乐清市| 石楼县| 德令哈市| 前郭尔| 青铜峡市| 宜宾市| 芒康县| 克山县| 方正县| 都江堰市| 河曲县| 虹口区| 沛县| 霍州市| 黎川县| 皮山县| 安陆市| 科技| 府谷县| 乐东| 灵川县| 依安县| 呈贡县| 温泉县| 永善县|