首页 > TAG信息列表 > 长可

不定长可重复字符组合枚举递归函数

p_len:字符组合长度 p_pool:用于收集字符组合的列表 possible_chars:指定字符集(字符串或字符列表) 1 def generator_passwd(p_len, p_pool, px=''): 2 for c in possible_chars: 3 if p_len > 1: 4 px = px[:6-p_len] 5 px += str(c) 6