A simple implementation of argmax and argmin in Python.