Is there a way to modify a variable twice in a one line if/else expression? it doesnt work with augmented assignement since this can not be destructured, so how could it be done if possible at all?
Augmented assignement is obviously not working:
var = 2
var += 1 *=3 if var > 1 else var
or
var = 2
var += 1, *=3 if var > 1 else var
or
var = 2
var += 1, var *=3 if var > 1 else var
New contributor
Joe is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
3