I need someone to explain this code for me please.(i would appreciate it if someone explained the whole code all together)
class Vector2D: def __init__(self, x, y): self.x = x self.y = y def __add__(self, other): return Vector2D(self.x + other.x, self.y + other.y) first = Vector2D(5, 7) second = Vector2D(3, 9) result = first + second print(result.x) print(result.y) alright, i already understand that in self.x , x is a variable not value (which idk why they didn't clarify.....i took some time to understand it on my own) someone once explained to me that self.full_name = name is like saying "self has a full name and this name is "name"" but what about result.x ? What does the dot mean here. Secondly : I understand that __init__ is a special method/dunder and that self.x would be equal to 5 in case of first and 3 in case of second! ( i am not sure) so who is other.x ?? Apparently other.x is supposed to be 3 but i don't understand how or why. How did python even understand that when we say other.x it means the "second" variable, nothing literally got assigned to the dunder __add__ at all.