Here's everything I got so far... I can't figure what I have done wrong
First my helper function
def max_min(l):
if isinstance (l[0], list):
result = max_min(l[0])
elif len(l) == 2:
if l[0] < l[1]:
result = l[0], l[1]
else:
result = l[1], l[0]
else:
Min, Max = max_min(l[1:])
if l[0] <= Min:
result = l[0], Max
elif l[0] >= Max:
result = Min, l[0]
else:
result = Min, Max
return result
When tried to do this
l = [6, 3, 7, 5, 5, 2, [3, 2], 1]
print max_min(l)
It gives me (2, 7)
which i expected to be (1, 7)
I'm out of ideas... anyone can point me out the directions?