Python If语句-IndentationError:应该缩进的块

时间:2019-12-28 17:07:55

标签: python

我的If语句怎么了?

 if (current_value_address == current_value['address'] and
     current_input['xy'] >= current_required_value and 
     current_xy_amount >= MIN_AMO and
     AFFL_COME > 1):

 getaf_id = db.cursor()

错误:

getaf_id = db.cursor()
IndentationError: expected an indented block

如果我删除If语句,它将起作用。

1 个答案:

答案 0 :(得分:2)

您只需要缩进最后一部分:

 if (current_value_address == current_value['address'] and
 current_input['xy'] >= current_required_value and 
 current_xy_amount >= MIN_AMO and
 AFFL_COME > 1):

     getaf_id = db.cursor().  #indent this line!