When executing my code below I get a syntax error:
expected an indented block
I have checked the tabs are not spaces as suggested on other threads. What is causing this?
if wallDirection = '-X':
xAxis = -buildingSectionWidth
When executing my code below I get a syntax error:
expected an indented block
I have checked the tabs are not spaces as suggested on other threads. What is causing this?
if wallDirection = '-X':
xAxis = -buildingSectionWidth
First see What is the difference between an expression and a statement in Python? An if
statement requires an expression as its condition.
wallDirection = '-X'
is a statement that assigns wallDirection
to the value -X
. The expression you likely want here is wallDirection == '-X'
. The operator that tests for equality is ==
, not =
.
if wallDirection == '-X':
xAxis = -buildingSectionWidth