Is there anyway in Python to convert a string of an operation into an operation and use it without using a lookup table?
I'm trying to make a program that will do postfix operations with stacks.
Assume the user types the expression in correctly each time.
>>278287
There is but you shouldn't.
https://nedbatchelder.com/blog/201206/eval_really_is_dangerous.html
>>278358
>https://nedbatchelder.com/blog/201206/eval_really_is_dangerous.htm
Well eval() might work. i'll just have to make it so that the operation must be 1 character long. Thanks!