I have a variable V which takes values { 1, 43, … } and I would like to assign to variable Z values { X1, X2, … } based on which exact value V has taken. Example: if V is 1, Z is X1. If V is, unexpectedly, not part of the set of defined values, the behaviour can be “undefined”.
Basically, I don’t know how to do a switch statement in Python. In the manual, I did not find “switch”.
You haven’t said what you want to happen if V is not one of the valid values.