即 nCr,which represents “n choose r”
import itertools
things = ["苹果", "桃子", "梨"]
print(list(itertools.combinations(things, 2)))
print结果:[('苹果', '桃子'), ('苹果', '梨'), ('桃子', '梨')]
更多用法:https://docs.python.org/3/library/itertools.html
即 nCr,which represents “n choose r”
import itertools
things = ["苹果", "桃子", "梨"]
print(list(itertools.combinations(things, 2)))
print结果:[('苹果', '桃子'), ('苹果', '梨'), ('桃子', '梨')]
更多用法:https://docs.python.org/3/library/itertools.html
VUE动态加载不同组件
举报文章
请选择举报类型
补充说明
0/200
上传截图
格式支持JPEG/PNG/JPG,图片不超过1.9M