lst = [1,2,3]
a = max(lst) #最大值
b = lst.index(max(lst)) #最大值的位置
print(“列表的最大值:{}”.format(a),“位置:{}”.format(b))
结果: 列表的最大值:3 位置:2
lst = [1,2,3]
a = max(lst) #最大值
b = lst.index(max(lst)) #最大值的位置
print(“列表的最大值:{}”.format(a),“位置:{}”.format(b))
结果: 列表的最大值:3 位置:2