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
Created at: 2019/04/27 12:16; Updated at: 2019/04/28 10:11