2016-11-07 70 views
0

我想創建一個元組列表,我越來越無效了Syntex:無效了Syntex(需要幫助!)

def match_enzymes(strand, enzymes, sequences): 
'''(str, list of str, list of str) -> list of (str, list of int) tuples 

Return a list of tuples where the first item of each tuple is the name of a restriction enzyme and the second item is the list of indices of the restriction sites that the enzyme cuts. 

>>> 
>>> 
>>> 
''' 

list_of_tuples = [] 

for i in range(len(enzymes)): 
    list_of_tuples.append((enzymes[i], restriction_sites(strand, sequence[i])) 

return list_of_tuples 
+2

縮進,你會得到無效的語法。 –

+0

[「預期的縮進塊」錯誤?](http://stackoverflow.com/questions/19657576/expected-an-indented-block-error) –

回答

0

兩個問題:

1)你缺少右括號中:

list_of_tuples.append((enzymes[i], restriction_sites(strand, sequence[i])) #<--!!! 

2)如果您的代碼縮進這樣你的代碼是不是目前