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)
Created at: 2015/06/05 09:08; Updated at: 2015/06/07 16:37