【发布时间】:2018-02-16 01:07:27
【问题描述】:
我正在尝试更新 Python 中的字典值。我正在尝试通过从值中减去 3 来更新 dict 中的值。
if buildings == 1:
workpower -= 3
if workpower >= 0:
farmplace1 = int(input("where do you want it?"))
farmplace2 = int(input("where do you want it?"))
board[farmplace1][farmplace2] = "F"
my_dict['d'] -= 3;
我收到以下错误
IndentationError: unindent does not match any outer indentation level
代码有什么问题?
【问题讨论】:
-
你的代码应该在每个 if 语句后缩进 4 个空格
-
编辑模式显示你正在混合制表符和空格,只使用空格
标签: python python-3.x dictionary indentation