HTML tutorial
CSS3 tutorial
Bootstrap tutorial
JavaScript tutorial
JQuery tutorial
AngularJS tutorial
React tutorial
NodeJS tutorial
PHP tutorial
Python tutorial
Python3 tutorial
Django tutorial
Linux tutorial
Docker tutorial
Ruby tutorial
Java tutorial
C tutorial
C ++ tutorial
Perl tutorial
JSP tutorial
Lua tutorial
Scala tutorial
Go tutorial
ASP.NET tutorial
C # tutorial
Math Methods : Find the number of ways to choose k things from n items
The math.perm()
method returns the number of ways to choose k items from n items with order and without repetition.
Parameter | Description |
---|---|
n | Required. Positive integers of items to choose from |
k | Optional. Positive integers of items to choose |
Note: If k is greater than n, it returns 0.
Note: If n or k are negative, a ValueError occurs. If n or k are not integers, a TypeError occurs.
Return Value: | An int value, representing the number of ways to choose k items from n items with order and without repetition |
---|---|
Python Version: | 3.8 |