I have a collection of two variables
a = 2
b = 3
collection = [a, b]
I randomly choose one of them as my first variable:
first_variable = random.choice(collection)
Later, I want to select the other variable and store it in other_variable
.
How can I do this only by referring to first_variable
and collection
?
other_variable = something like "variable in collection
that is not first_variable
"
Remark: The collection will always contain two elements only. Thank you.