没有项目描述
pymutation的Python项目详细描述
py突变
用于计算排列和组合的python库
示例:
frompymutationimportpymutation# A reading list contains 11 novels and 5 mysteries.books=['N','N','N','N','N','N','N','N','N','N','N','M','M','M','M','M']# In how many different ways could a student select# a. a novel or a mystery?print(pymutation(books,[lambdax:x=='N'orx=='M']))# 16# b. a novel and then a mystery?print(pymutation(books,['N','M']))# 55# c. a mystery and then another mystery?print(pymutation(books,['M','M']))# 20