Class it up


#1

Why should self be the only argument in the method check_angles?
Why does the code in the picture not work?
Please help me understand.


#2

if we give check_angles 4 parameters like you did, we would have to provide the angles again when calling check_angles method, this is not DRY


#3

Thank you for the reply.But we do have to provide the angles when calling check_angles method anyways..


#4

no? we supply the angles (for example 45, 35 and 100) when we create a class instance, then to supply this values (45, 35 and 100) again when calling check_angles method is not DRY

We can just use the instance variable (self.angle1 and so on) we created in init in check_angles method so we don't have to supply the angles (45 and so on) again when calling check_angles


#5

Oh ok,I understood now..Thank you


#6

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.