expression = [\'+\', \'10\', \'x\'] variables = {"x": (3,4)} new_expression = [] for key, value in variables.items(): key_index = expression.index(key