def max1(l, left, right): if left == right: return l[left] return max(l[left], max1(l,left+1, right)) lst = [4,5,-50] m = max1(lst,0, 2)