So if my string is \"the dude is a cool dude\". I\'d like to find the first index of \'dude\':
mystring.findfirstindex(\'dude\') # should return 4
def find_pos(chaine,x): for i in range(len(chaine)): if chaine[i] ==x : return 'yes',i return 'no'