I'm guessing you're starting Python scripting with a background somewhere else, where a switch
statement would solve your question. As that's not an option in Python, you're looking for another way to do things.
Without context, though, you can't really answer this question very well (there are far too many options).
I'll throw in one (somewhat Pythonic) alternative:
Let's start with an example of where I think you're coming from.
def add_to_x (x):
if x == 3:
x += 2
elif x == 4:
x += 4
elif x == 5:
x += 5
return x
Here's my alternative:
def add_to_x (x):
vals = { 3 : 5 , 4 : 8 , 5 : 10 }
return vals[x]
You can also look into lambdas which you can put into the dictionary structure I used.
But again, as said, without context this may not be what you're looking for.