Get item at specific index in list
To get item from a list, at specific index, in Python, we can use square bracket notation on the list.
The syntax of the expression to get an item from list x at index i is
1. Get item at index 4 in list x
In the following program, we take a list x, get the value at index 4, and print it to console output.
['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'] 0 1 2 3 4 5 6 7 <- indices x = 'e'
In this tutorial of Python Examples, we learned how to get an item from the list at specified index, with the help of well detailed examples.