假定有3个位置,每个位置的字符取值可能为"A"或"T",如何输出所有可能的字符串?
import itertools
for seq in itertools.product("AT", repeat=3):
# seq is a tuple of 3 strings
# one case in seq is ("A","A","A")
seq = "".join(seq)
print(seq)
假定有3个位置,每个位置的字符取值可能为"A"或"T",如何输出所有可能的字符串?
import itertools
for seq in itertools.product("AT", repeat=3):
# seq is a tuple of 3 strings
# one case in seq is ("A","A","A")
seq = "".join(seq)
print(seq)