• Index Power

Question related to mission Even the Last

 

def indexpower(array, n): if 0<len(array)<=10: if 0<n<len(array)+1: b=array[n-1]**(n) elif (n)==0: b=array[n-1] elif (n)<=0: b="-1" else: b="-1" else: b=">0 and <=10" return b arr=(7,2,3,4,0) n=3 result=indexpower(arr,n) print(result)