- 1

Permutations in python

You need to write a function is_even(p) that returns True for even permutations and False for odd permutations(in python)

4th Jun 2020, 12:35 PM
Ilyas babu
3 odpowiedzi
0
def is_even(p): result=(len(p)-1)%2 if result: return False else: return True I tried but got incorrect i dont know why
4th Jun 2020, 12:51 PM
Ilyas babu