File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 11"""
22Generalized combinations (n choose r) calculator for real total and integer choose.
3- Wikipedia URL: https://en.wikipedia.org/wiki/Binomial_coefficient
3+ Wikipedia URL:
4+ https://en.wikipedia.org/wiki/Binomial_coefficient
45"""
56
67from math import factorial as math_factorial
@@ -70,5 +71,8 @@ def combinations(total: float, choose: int) -> float:
7071
7172 # Example usage
7273 total_input = float (input ("Enter total (real number): " ).strip () or 0 )
73- choose_input = int (input ("Enter choose (integer): " ).strip () or 0 )
74- print (f"combinations({ total_input } , { choose_input } ) = { combinations (total_input , choose_input )} " )
74+ choose_input = int (input ("Enter choose (non-negative integer): " ).strip () or 0 )
75+ print (
76+ f"combinations({ total_input } , { choose_input } ) = "
77+ f"{ combinations (total_input , choose_input )} "
78+ )
You can’t perform that action at this time.
0 commit comments