for loop - Python - Syntax error with nested iterations? -


so have code:

chars = maketrans(" abcdefghijklmnopqrstuvwxyz-.,"," abcdefghijklmnopqrstuvwxyz-.,");  input = input.split(" "); length = len(input); charlength = len(chars);     x in range(1,length):             y in range(1,charlength):                 z in range(minint,maxint):                     if transform(z + x.translate(chars) + key)[:5] == input[x]                         print x.translate(chars) 

the function receives blocks of 5 characters separated spaces. when attempting run it, following error:

file "sh25.py", line 21 if transform(z + x.translate(chars) + key) == input[x]                                                          ^ syntaxerror: invalid syntax 

i'm admittedly newbie @ python, help? thanks.

the error message pretty precise: need : after if

if transform(z + x.translate(chars) + key)[:5] == input[x]: 

Comments

Popular posts from this blog

php - render data via PDO::FETCH_FUNC vs loop -

c# - Why won't my code write to SQL? -

c# - Avoiding duplicate methods for Task and Task<T> -