2016-11-07 1 views
0

Ich versuche, eine Liste von Tupeln zu erstellen, und ich bin immer ungültig Syntex:Ungültige Syntex (brauchte Hilfe!)

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

Wenn Ihr Code wie folgt eingekerbt ist, würden Sie ungültige Syntax erhalten. –

+0

Mögliches Duplikat von ["Erwarteter eingerückter Block" -Fehler?] (Http://stackoverflow.com/questions/19657576/expected-an- eingerückt-Block-Fehler) –

Antwort

0

zwei Probleme:

1) Sie vermissen die schließenden Klammern in:

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

2) Code zur Zeit nicht eingerückt ist

Verwandte Themen