0
Magic Methods Help
I need some help understanding magic methods. I understand most of it but im not seeing how a few things work like how can other have other.x and other.y...also how is it adding both bottom values https://code.sololearn.com/cGmPHDcEi9ZG/?ref=app https://code.sololearn.com/cGmPHDcEi9ZG/?ref=app
5 Answers
0
The __add__ method is called by the + operator, and is passed âsecondâ as an argument. Thus, thr vector assigned to âsecondâ appears as the parameter âotherâ in the __add__ code.
0
yeah im still super confused đ
0
Well...
Maybe you should back up. This is very simple unless one didnât learn OOP, in which case it could be very difficult.
0
Ill try to explain with code...
0
Here. Take a look at this code, then see the result.
https://code.sololearn.com/co7aOas1U9jl/?ref=app