need help in understanding the variables in the below code.
class Student:
def __init__(self,m1,m2):
self.m1 = m1
self.m2 = m2
def __add__(self, other):
m1 = self.m1 + self.m2 <---- doubt
m2 = other.m2 + other.m2
s3 = Student(m1,m2)
return s3
s1 = Student(50,60)
s2 = Student(70,80)
s3 = s1 + s2
print (s3.m1)
So i get the desired output of 110 here. But my question is why should the variable in add function be declared only as m1 and not as any other variable. Does it have to match with the variable name in "init" function? If yes what is the reason for it.