2
我添加了一个elif的语句来我的代码:“语法错误:无效的语法”在有效的语句
if i % 100 < 10:
letter_count += numletters[str(i)[len(str(i)) - 1]
elif (i % 100 >= 10) and (i % 100 < 20):
letter_count += numletters[str(i)[len(str(i)) - 2:]]
,现在它给我一个语法错误:
File "<stdin>", line 35
elif (i % 100 >= 10) and (i % 100 < 20):
^
SyntaxError: invalid syntax
我不知道什么是错的在此陈述中,请提前感谢您的帮助。
这个问题似乎是无关紧要的,因为它太局限了。 – hjpotter92
如果标题更像是“Python SyntaxError on valid syntax”,那么它就不会像本地化一样。 – SethMMorton