小册名称:Python合辑4-130个字符串操作示例
在 Python 中获取字符的位置
test = 'Position of a character'print(test.find('of'))print(test.find('a'))
test = 'Position of a character'
print(test.find('of'))
print(test.find('a'))
Output:
912
9
12