最佳答案
我对 python 还是个新手,不太能理解 find 和 index 之间的区别。
>>> line
'hi, this is ABC oh my god!!'
>>> line.find("o")
16
>>> line.index("o")
16
它们总是返回相同的结果。 谢谢!