Write a python function to find nCr
Topic: Write a python function to find nCr
Solution
def nCr(n, r): def fact(n): res = 1 for i in range(2, n+1): res = res * i return res return (fact(n) / (fact(r) * fact(n - r)))
List all Python Programs
Solution
def nCr(n, r): def fact(n): res = 1 for i in range(2, n+1): res = res * i return res return (fact(n) / (fact(r) * fact(n - r)))