list value extraction using python 1

list value extraction using python

# make a list
my_list = [1, 2, 3, 4]

# extract/get value by index
print(my_list[0])

Here is what the above code is Doing:
1. We create a list called my_list.
2. We print the first element of the list.

The first element of the list is at index 0.

Similar Posts