我有一长串代码,我希望在多行之间分解.我使用什么,语法是什么?
例如,添加一串字符串,
e = 'a' + 'b' + 'c' + 'd'
Run Code Online (Sandbox Code Playgroud)
并将它分成两行:
e = 'a' + 'b' +
'c' + 'd'
Run Code Online (Sandbox Code Playgroud) 我在我的代码中添加了一个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:]]
Run Code Online (Sandbox Code Playgroud)
现在它给了我一个语法错误:
File "<stdin>", line 35
elif (i % 100 >= 10) and (i % 100 < 20):
^
SyntaxError: invalid syntax
Run Code Online (Sandbox Code Playgroud)
我不知道该声明有什么问题,在此先感谢您的帮助.