使用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