I am a beginner working my way through How To Think Like A Computer Scientist. I am having a problem with an exercise that multiplies a matrix by a scalar. def scalar_mult(n, m), n being the scalar and m being the matrix.
My code works but I guess its not a pure function because if I put in

>>> m = [[1, 2], [3, 4]]
>>> scalar_mult(3, m)

my return is [[3, 6], [9, 12]] which is correct,...