Answers for "nPr python"

0

nPr python

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))
Posted by: Guest on June-20-2020

Python Answers by Framework

Browse Popular Code Answers by Language