I want to extract specific string from a string, but it shows error. Why can't I use the find as index to extract string ?
Here is my code
string = 'ABP'
p_index = string.find('P')
s = string[0, p_index]
print(s)
TypeError: string indices must be integers