Python check if list is permutation. I am new to Python.