Python List Indexing: Access Elements by Index
You can access a specific element in a list by using its index. Indexing in lists starts from 0, so the index of the first element is 0, the second element is 1, and so on.
For example, if you have a list called my_list and you want to retrieve the third element, you can do it like this:
my_list = [1, 2, 3, 4, 5]
element = my_list[2]
print(element) # 输出 3
This way, you can access the specified element in the list.