Python 查找字符在字符串中的位置实例 如下所示:str_1='woshiyizhidadaniu'char_1='i'nPos=str_1.index(char_1)print(nPos)运行结果:7========是使用fi 查找字符串位置