I have the following Python code (simplified for brevity):
architecture = 'windows'
arch_windows = 125
arch_linux = 999
if architecture == 'windows':
variable = arch_windows
else:
variable = arch_linux
How can this assignment be simplified? In essence I'd like to be able to write it as: variable = value of variable with the name of ('arch_' + architecture)
because in my code I have a lot of such variables that I'd like to assign according to the value of a control variable (called architecture in the snippet)
Is it possible in Python?