First solution in Clear category for Index Power by
def index_power(array, n):
Oct. 15, 2014
A nice compact solution.
except without type is the root of all evil (= hours finding a bug).
True in most cases, not in this one. You are not expected to cover every possible bug as n being outside the list is the only thing that can happen.