<s>[INST] How to get the position of a character in Python? How can I get the position of a character inside a string in python?
 [/INST] There are two string methods for this, find and index.
Example:
>>> myString = "Position of a character"
>>> myString.index('s')
2

The difference is that find returns -1 when what you're looking for isn't found. index throws an exception.

Function str.find(sub[, start[, end]])
  Return the lowest index in the string where substring sub is found, such that sub is contained in the range [start, end]. Optional arguments start and end are interpreted as in slice notation. Return -1 if sub is not found. 

And:

Function str.index(sub[, start[, end]])
  Like find(), but raise ValueError when the substring is not found.

 </s>