Backtracking: all permutations — Python practice — Live Code Tutor