Home >>Python math Module >Python math.perm() Method
Python math.perm() method is used to return the number of ways to choose k items from n items with order and without repetition. The k parameter is an optional parameter.
Syntax:math.perm(n, k)
Parameter | Description |
---|---|
n | This is a required parameter. It defines a positive integers of items to choose from. |
k | This is an optional parameter. It defines a positive integers of items to choose. |
import math
n = 7
k = 5
print (math.perm(n, k))