python快速計算排列組合,附實例

#調用scipy科學計算包中計算排列組合(permutation and combination)的模塊 from scipy.special import perm, comb #從3我的中抽取任意兩人去排隊搶優衣庫,有多少種情形(注意要排隊!): p = perm(3,2) #從3我的中抽取任意兩人組成好基友,有多少種情形(基友之間不排隊): c = comb(3,2) print(p,c
相關文章
相關標籤/搜索