0
Why we use s3=student(m1,m2) ?
Hi guys can you please tell me y we use s3 =student(m1,m2) in add method. I am getting confused https://code.sololearn.com/cuFUV5hpGph3/?ref=app
2 ответов
+ 4
When you do "s3=s1+s2"
__add__ method is called where s3=student(m1, m3) instantiates new object s3 of class student with values m1 and m3 and returns the newly created object.
i can't answer "Why" though but i told you what is going on. Maybe that's what the program was supposed to do ?
+ 1
Thank you