MCPcopy Index your code
hub / github.com/python/cpython / numcombs

Method numcombs

Lib/test/test_itertools.py:328–331  ·  view source on GitHub ↗
(n, r)

Source from the content-addressed store, hash-verified

326 yield tuple(pool[i] for i in indices)
327
328 def numcombs(n, r):
329 if not n:
330 return 0 if r else 1
331 return fact(n+r-1) / fact(r)/ fact(n-1)
332
333 for n in range(7):
334 values = [5*x-12 for x in range(n)]

Callers

nothing calls this directly

Calls 1

factFunction · 0.85

Tested by

no test coverage detected