使用scipy.special库即可
# -*- coding: utf-8 -*-
"""
Created on Mon Sep 20 14:15:22 2021
@author: Machi
"""
import scipy.special
#Calculate permutation number
a=scipy.special.perm(3,2)
#Calculate the number of combinations
b=scipy.special.comb(

通过引入scipy.special库,可以轻松地在Python中进行排列组合计算。示例中展示了计算6选3的情况。
最低0.47元/天 解锁文章
1万+

被折叠的 条评论
为什么被折叠?



