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

4th Jun 2020, 12:54 PM
Ilyas babu
2 Réponses
+ 1
Please more elaborate on your question.
4th Jun 2020, 1:06 PM
Maninder $ingh
Maninder $ingh - avatar
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):
4th Jun 2020, 1:10 PM
Ilyas babu