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

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?

主站蜘蛛池模板: 新化县| 丰县| 威信县| 兰西县| 萨嘎县| 济宁市| 栾城县| 自贡市| 冀州市| 治县。| 盈江县| 驻马店市| 临海市| 承德县| 平昌县| 宁城县| 广德县| 台山市| 当涂县| 织金县| 麻阳| 阳曲县| 漳浦县| 全椒县| 丹巴县| 闸北区| 万年县| 汕头市| 邵阳市| 信宜市| 酒泉市| 平果县| 南川市| 中卫市| 闵行区| 吴川市| 东明县| 孙吴县| 获嘉县| 定陶县| 上蔡县|