I'm trying to write an inline if/else statement that assigns two values based on a single condition. Something to the effect of:
x = y = 0
value = 11
threshold = 5
x, y = x+1, 0 if value <= threshold else x, y = x-1, value
I'd expect this code to result in x = -1 and y = 11.
When I run this, I get this error: SyntaxError: cannot assign to literal.
I played around with parenthesis, but couldn't get anything to work.
Is there a way to do this? I can work around this, but this would be especially convenient.