make_operator(op_symbol) where op_symbol is one of "+", "-", "*", "/". It should return a new two-argument function that performs the corresponding arithmetic operation. If op_symbol is not recognized, make_operator should raise a ValueError immediately (not when the returned function is later called).times = make_operator("*")
times(6, 7)42
make_operator("*") returns a function equivalent to multiplication; calling it with 6, 7 gives 42.
make_operator("%")ValueError raised
"%" is not one of the four supported symbols, so the error is raised right away, before any function is returned.
Validate op_symbol with an if/elif chain (or membership check against a set) before defining/returning the inner function.
Define a distinct small inner function per branch, or one inner function that closes over the already-validated op_symbol and branches internally.