Math Functions
math.perm()
Count ordered selections without repetition. With k omitted or None count all permutations; k greater than n gives zero.
Formal Syntax & Structure
python syntaxpython
math.perm(n, k=None, /)Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| n | int | Nonnegative integer input. |
| k | int or None | Number of items to select; None means all items for perm. |
Return Value
int
Integer result, exact for integer arithmetic.
Working Example
Example Snippetpython
import mathprint(math.perm(5, 2))