1、Python的min函数返回列表中的最小的项。



2、如何返回列表中最小的项的索引?


def indexofMin(arr): minindex = 0 currentindex = 1 while currentindex < len
(arr):if arr[currentindex] < arr[minindex]: minindex = currentindex
currentindex +=1 return minindex arr = [3,5,2,1] print(indexofMin(arr))

友情链接
KaDraw流程图
API参考文档
OK工具箱
云服务器优惠
阿里云优惠券
腾讯云优惠券
华为云优惠券
站点信息
问题反馈
邮箱:[email protected]
QQ群:637538335
关注微信