Is there any way to use a numeric operator from a list in a sum. For example, if I had a list called BASICOPS
, which consisted of ['+']
, could I then use it in a sum, which is for example:
(1,(BASICOPS),2)
to make the sum 1+2
?
I am trying to do this to make a game where the operator for a question is random. So in the game the list would have mulitple operators, and these would be selected randomly using their index, which would be randomly selected.