• why

Question related to mission Index Power

 

why this is not working

def index_power(array: list, n: int) -> int:
    if N < len(array):
        return (array[n] ** n)
    else : 
        return -1

and this works.

def index_power(array, n):

    return array[n]**n if n < len(array) else -1