What would be the best way to find the index of a specified character in a list containing multiple characters?
>>> ['a', 'b'].index('b')
1
If the list is already sorted, you can of course do better than linear search.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With