擅长:python、mysql、java
<p>您必须在list2上迭代两次。一次用于所有可能的第一个元素,第二次用于所有可能的结束元素。你知道吗</p>
<pre><code>list1 = ["ACCC", "ACGT", "CGCG", "TGAA"]
list2 = ['A', 'C', 'G', 'T']
output = []
for code in list1:
for start_el in list2:
for end_el in list2:
output.append(start_el + code[1:-1] + end_el)
print(output)
</code></pre>