Permutations in python | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
- 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
1 Respuesta
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