On 9/29/21 23:11, Anil Anvesh wrote:
I want to write a python calculator program that has different methods to add, subtract, multiply which takes 2 parameters. I need to have an execute method when passed with 3 parameters, should call respective method and perform the operation. How can I achieve that?
let me add - this is probably not the place you are in your Python learning, so don't worry about this, but the operator module is designed for these kind of usages, when you want to pass an operator like + - etc. but of course can't pass the op itself to take actions because it's not a callable - the operator module has callables that can be used.
-- https://mail.python.org/mailman/listinfo/python-list