I am trying to update a dictionary value in Python. I'm trying to update a value in the dict by subtracting 3 from the value.
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;
I get the following error
IndentationError: unindent does not match any outer indentation level
What is wrong with the code?
Change your indentation and ensure it's consistent ( just use spaces or just use tabs, don't mix both ):
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With