- Hands-On Data Science and Python Machine Learning
- Frank Kane
- 57字
- 2021-07-15 17:15:01
Dereferencing an element
We can also dereference the elements of a tuple, so element number 2 again would be the third element, because we start counting from 0, and that will give me back the number 6 in the following screenshot:
y = (4, 5, 6)
y[2]
The output to the above code is as follows:
6