0

# Permutation in python

I have an assignment to submit today itself and tried to answer it like below but i got that the answer was incorrect . Whats wrong def is_even(p): result=(len(p)-1)%2 if result: return False else: return True

2 Answers

+ 1

Please more elaborate on your question.

0

Sorry i forgot to mention the question. Write a function is_even(p) that return true for even permutation and false for odd permutations. And first line should be def is_even(p):