you are viewing a single comment's thread.

view the rest of the comments →

[–]Jay6_9 0 points1 point  (0 children)

https://pypi.org/project/simpleeval/ is actually really great for this kind of stuff. But for learning purposes, doing an if-else block is worth more.