I’m trying to make a script that evaluates a word to see whether or not its parts add up to 23 in any way (all four operations).
I’ve gotten it down to creating a string list of possible equations:
answerList = [12+15+12,12+15-12,12+15/12,...]
The problem I’m now getting is that I cannot get them back out of the lists in integer format to see whether or not they actually equal 23/32.
Check out the eval() function
Then, you can just loop through the list, calling eval on each while doing something with the result.