Python find position in a list code example
Example 1: how to find the position in a list python
lst = [4, 6, 5]
lst.index(6) # will return 1
Example 2: get index of item in list
list.index(element, start, end)
Example 3: how to index python
#you can index in a string like:
string='cupcake'
string[0]#returns 'c'
#you can index in a list like:
list = ['red', 'blue', 'green']
list[0]#returns 'red'
list[0][0]#returns[0] of 'red' wich is r