0
How to create operator in python
I want to create new operator. I want to create operator +- and -+ that would do adding and subtraction at the same time. It would give tuple. It would have to have same precedence as + and - E.g. x, y = 5, 3 x +- y == (8, 2) x -+ y == (2, 8)
4 Respuestas
+ 3
Try looking into libraries.
+ 2
A collection of code that will make your life easier.
+ 1
@Private [GER]
What is library
0
1st thing...
what u wanna do...
is not actually a operator...
a operator when used with 2 numbers gives or returns 1 ans...
what u want is certainly looks like a func..
returning a+b and a-b