libb.choose

choose(n, k)[source]

Compute binomial coefficient (n choose k).

Parameters:
  • n (int) – Total items.

  • k (int) – Items to choose.

Returns:

Number of combinations.

Return type:

int

Example:

>>> choose(10, 3)
120