Loop through all the elements in the list with the for loop. Set the variable storing the max/min value to the fist element in the list to start with. Otherwise, you could end up with invalid values.
max_v=l[0]
for i in l:
if i>max_v:
max_v=i
min_v=l[0]
for i in l:
if l