在dna中有四中碱基,分别为ATCG,其中符号A与T是互补,符号C与G是互补的,请编写函数DNA_strand(dna)
时间: 2023-03-16 19:44:12 浏览: 363
DNA序列互补和匹配特征分析与可视化系统
回答:DNA_strand(dna)函数的实现如下:def DNA_strand(dna):
complementary = ""
for letter in dna:
if letter == "A":
complementary += "T"
elif letter == "T":
complementary += "A"
elif letter == "C":
complementary += "G"
elif letter == "G":
complementary += "C"
return complementary
阅读全文