Python elif语法错误

时间:2015-07-01 05:10:42

标签: python

获取错误:

ev3rest@EV3RESTs-MBP ~/Desktop> python telegram.py
  File "telegram.py", line 55
    elif message == '/start':
       ^
SyntaxError: invalid syntax

代码:

if message == '/help':
send_respond ('/help respond message', from_id)
elif message == '/start':
    send_respond ('/help - Show available commands list', from_id)
elif message == 'Привет':
    send_respond ('Приветики!', from_id)

不知道如何修复它,我检查了标签,但这不起作用:/

1 个答案:

答案 0 :(得分:1)

向后缩进这一步:

if message == '/help':
    send_respond ('/help respond message', from_id)  #<------------------HERE