导入python自带的工具包:
import itertools
使用方法如下:
list(itertools.combinations(['a','b','c'], 2))
返回:[('a', 'b'), ('a', 'c'), ('b', 'c')]
list(itertools.combinations("abc", 2))
同样返回:[('a', 'b'), ('a', 'c'), ('b', 'c')]
导入python自带的工具包:
import itertools
使用方法如下:
list(itertools.combinations(['a','b','c'], 2))
返回:[('a', 'b'), ('a', 'c'), ('b', 'c')]
list(itertools.combinations("abc", 2))
同样返回:[('a', 'b'), ('a', 'c'), ('b', 'c')]

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