The math.perm() function computes the number of ways to choose k items from n items with order and without repetition. 

Syntax:
math.perm(n, k = None)
copy

The optional parameter k, if not specified,  defaults to n.
The function returns the value of  n! / (n - k)!  when k <= n . If k > n, the function returns  zero.

ExampleEdit & Run
import math

print(math.perm(3))
print(math.perm(5))
print(math.perm(10, 3))
print(math.perm(14, 7))
print(math.perm(100, 10))
copy
Output:
6 120 720 17297280 62815650955529472000 [Finished in 0.01189941680058837s]

The function  raises TypeError if either of the arguments are not integers. A ValueError if either of the arguments are negative.

ExampleEdit & Run
import math
math.perm('5', 5)
copy
Output:
Traceback (most recent call last):   File "<string>", line 2, in <module> TypeError: 'str' object cannot be interpreted as an integer [Finished in 0.011247531976550817s]
ExampleEdit & Run
import math

math.perm(-10, 2)
copy
Output:
Traceback (most recent call last):   File "<string>", line 3, in <module> ValueError: n must be a non-negative integer [Finished in 0.011671914253383875s]