find item inlist code example
Example 1: identify list elements python
# app.py
streaming = ['netflix', 'hulu', 'disney+', 'appletv+']
index = streaming.index('disney+')
print('The index of disney+ is:', index)
Example 2: python check if list contains
# To check if a certain element is contained in a list use 'in'
bikes = ['trek', 'redline', 'giant']
'trek' in bikes
# Output:
# True