""" Ex. 3.28 from "A Primer on...". Write functions min and max, to find the minimum and maximum value in a list. The exercise does not ask us to write test functions, but these are added examples. """ def max(a): max_a = a[0] for e in a[1:]: if e > max_a: max_a = e return max_a def min(a): min_a = a[0] for e in a[1:]: if e < min_a: min_a = e return min_a l = [1,2,4,6,4,3,1] print(f"Smallest value = {min(l)}") print(f"Largest value = {max(l)}") """ Terminal> python maxmin_list.py Smallest value = 1 Largest value = 6 """