📜  nPr python 代码示例

📅  最后修改于: 2022-03-11 14:45:59.879000             🧑  作者: Mango

代码示例1
import math 
def fact(n):  
    if (n <= 1): 
        return 1
    return n * fact(n - 1)  
  
def nPr(n, r):  
    return math.floor(fact(n)/fact(n - r))  
    
print(nPr(4,2))