Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

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))
Comment

PREVIOUS NEXT
Code Example
Python :: what is // in python 
Python :: input multiple values in python 
Python :: passing user instance django form submission 
Python :: list comprehension if else 
Python :: manipulate ip address in python 
Python :: how to add a function in python 
Python :: reverse an array python 
Python :: anaconda snake 
Python :: affinity propagation python 
Python :: pyspark split dataframe by rows 
Python :: difference between generator and iterator in python 
Python :: csv library python convert dict to csv 
Python :: multinomial regression scikit learn 
Python :: python try except raise error 
Python :: python mahalanobis distance 
Python :: pandas fill nan methods 
Python :: Adjusting Subplot Margins in Matplotlib 
Python :: how to delete file in python 
Python :: python nth prime function 
Python :: as type in pandas 
Python :: program for factorial of a number in python 
Python :: how to change the console background color in python 
Python :: how to get dummies in a dataframe pandas 
Python :: check for missing values in pandas 
Python :: add css in html django 
Python :: concat dataframes 
Python :: python insertion sort 
Python :: creating a list in python 
Python :: python install jedi 
Python :: django models integer field default value 
ADD CONTENT
Topic
Content
Source link
Name
3+2 =