所以我有这段代码:
Chars = maketrans(" ABCDEFGHIJKLMNOPQRSTUVWXYZ-.,"," ABCDEFGHIJKLMNOPQRSTUVWXYZ-.,");
input = input.split(" ");
length = len(input);
charLength = len(Chars);
for x in range(1,length):
for y in range(1,charLength):
for z in range(MinInt,MaxInt):
if Transform(z + x.translate(Chars) + Key)[:5] == input[x]
print x.translate(Chars)
该函数接收由空格分隔的5个字符的块。尝试运行它时,我收到以下错误:
File "SH25.py", line 21
if Transform(z + x.translate(Chars) + Key) == input[x]
^
SyntaxError: invalid syntax
我当然是Python的新手,但有人可以帮忙吗?感谢。
答案 0 :(得分:1)
错误消息非常精确::
if
if Transform(z + x.translate(Chars) + Key)[:5] == input[x]: