递归 判断数组最大数字

def Max(list):
    if len(list) == 2:
        if list[0] > list[1]:
            return list[0]
        else:
            return list[1]
    max_number = Max(list[1:])
    if list[0] < max_number:
        list[0] = max_number
    return list[0]

if __name__ == '__main__':
    list = [5,6,1,2,11,95,67]
    print (Max(list))
原文地址:https://www.cnblogs.com/j657521265/p/9901089.html