【发布时间】:2020-03-20 16:41:53
【问题描述】:
这可能是一个愚蠢的问题,但有些东西对我来说并不重要。
我的代码:
lowercase_letters = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
combos = list(product(lowercase_letters_ascii, repeat=3))
这将创建 15625 个组合。不应该有 17576 (26^3) 个组合吗? 我错过了什么?
谢谢
【问题讨论】:
-
“我错过了什么?”字母“j”:-)
-
哦,太尴尬了。谢谢。
-
请注意,Python 有一个
string.ascii_lowercase。
标签: python permutation product itertools