主页
Python
Python math.comb() 方法
demo_ref_math_comb
运行 ❯
×
更改方向
保存代码
更改主题
# Import math Library import math # Initialize the number of items to choose from n = 7 # Initialize the number of possibilities to choose k = 5 # Print total number of possible combinations print (math.comb(n, k))
C:\Users\My Name>python demo_math_comb.py
21