It is possible to assign values to multiple variables.
a, b = 5, 10
I need to assign those values based on a condition and I tried,
a, b = 1, 1 if c == 1 else 5, 10
It resulted a ValueError.
ValueError: too many values to unpack
I tried with two conditions for each and it was a success.
a, b = 1 if c == 1 else 5, 1 if c == 1 else 10
But I need to achieve this using a single if condition, single line. I know this reduces the readability. But still is it possible? What am I doing wrong here?