Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Uncategorized category for Index Power by LT04
def index_power(array, n):
"""
Find Nth power of the element with index N.
"""
if len(array) < n+1:
return -1
else:
x = array[n]**n
return x
if __name__ == '__main__':
#These "asserts" using only for self-checking and not necessary for auto-testing
print("Coding complete? Click 'Check' to review your tests and earn cool rewards!")
Oct. 19, 2017