find the place of element in list python 1

find the place of element in list python

streaming = ['netflix', 'hulu', 'disney+', 'appletv+']

index = streaming.index('disney+')
print('The index of disney+ is:', index)

Here is what the above code is Doing:
1. We create a list called streaming and assign it to the variable streaming.
2. We create a variable called index and assign it to the index of the value ‘disney+’ in the list streaming.
3. We print the value of index.

Similar Posts