python列表如何求最大值啊?列表:ls = [2,41,5,67,135,0,3,2]
两种办法:1、用max函数,max(ls)2、用sorted函数ls = sorted(ls)max_ = ls[-1]print(max_)
max(ls)
max函数 max(变量)