0
我一直在问:的SyntaxError而定义和调用函数
Write a function called
start_codon
which accepts a DNA sequence as its argument and returns the first codon as a string.
这是我到目前为止有:
#!/usr/bin/python
def start_codon(dna):
codon1 = dna[0:3]
codonstring = codon1.split(",");
return codonstring
print (start_codon(“ATGGAACCAACGTCAGTGACTTCGTCAG”))
然而,当我按回车键,试图调用该函数,我收到语法错误:
File "<stdin>", line 1
print (start_codon(“ATGGAACCAACGTCAGTGACTTCGTCAG”))
^
您发布的样本看起来像有“卷曲的引号”。你需要简单的“直”双引号或单引号字符。 – BrenBarn 2014-11-04 18:15:01
还要注意,尽管名称是“codonstring”,但它仍然是一个列表。 – jonrsharpe 2014-11-04 18:15:58
@jonrsharpe我怎么把它变成逗号分隔的列表?我认为这就是第二个参数 – movietime 2014-11-04 19:00:14