n values, decide whether its contents are exactly a permutation of [0, 1, 2, ..., n - 1].pow(a: float, b: int) to compute a raised to the integer power b.any / all, and clean expressions is valued.is_permutation([2, 0, 3, 1]) # True
The list contains every value from 0 through 3 exactly once.
is_permutation([1, 0, 1]) # False
For a list of length three, the required values are 0, 1, and 2; 2 is absent and 1 is repeated.
pow(3.0, 4) # 81.0
Raising 3.0 to the fourth power produces 81.0.
pow(5.0, -2) # 0.04
A negative exponent takes the reciprocal, so the result is 1 / (5.0 ** 2).
pow(7.0, 0) # 1.0
Any nonzero base raised to the zeroth power evaluates to 1.0.