I'm trying to implement a simple maths game where the user is given random numbers and operators then they have to work out the answer, I found sources on the internet that suggested using the operator module, which is why i used it, if there is a more efficient/ easier way of achieving this I am very open for interpretation.
Essentially i am trying to remove this horrible <built-in function add> and swap it to be more user friendly by saying '+' or 'add', something along those lines but i keep getting the error 'TypeError: 'bool' object is not callable - python', i really dont know what this means, i am new to python and am very confused.
from operator import add, sub, mul, floordiv
operators = (add == str("add"), sub == str("subtract"), mul == str("multiply"), floordiv == str("divide"))
operator = random.choice(operators)
answer = operator(number1, number2)
question = print("What is ", number1, operator, number2, "?")
operatorstuple to a dictionary as shown in this postoperatormodule at all.