I want to make a function that allows doing ++ operator in Python, does it use replace?
I tried:
def eval_func(variables):
equation = equation.split("++", "+=1");
return eval(equation, variables);
What would I do?
>Solution :
You should use += 1 instead of ++. It’s not python style.