Having trouble making this function work.

I don’t know Python.