I found an interesting problem on https://www.codewars.com/kata/59b139d69c56e8939700009d:
Write a method named `getExponent(n,p)` that returns the largest integer exponent `x` such that p^(x) evenly divides `n`. if `p<=1` the method should return `null`/`None` (throw an `ArgumentOutOfRange` exception in C#).

I tried it in Python, but could not do it. Can you solve it?
def get_exponent(n, p):
  return next(iter(i for i in range(int(abs(n) ** (1/p)), 0, -1) if (n / p**i) % 1 == 0), 0) if p > 1 else None