Python 是否有像 min() 和 max() 这样的内置函数,只是它返回索引而不是项目?
最佳答案
没有内置函数。你可以只做 your_list.index(min(your_list))
。
关于Python min 和 max 函数,但带有索引,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17309163/
Python 是否有像 min() 和 max() 这样的内置函数,只是它返回索引而不是项目?
最佳答案
没有内置函数。你可以只做 your_list.index(min(your_list))
。
关于Python min 和 max 函数,但带有索引,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17309163/