Just like we did with the Triangle’s angle values, we are going to now assign the angle1, angle2, and angle3 values. This can be done like self.angleN = self.angle, since all angles are the same for an equilateral triangle.
The most common issues here are spelling-related, so double check your spelling! Also, be sure not to write the assignment backwards, like this: self.angle = self.angleN.
You don’t.
Or rather you do that in the definition, not in the instance creation. So if you mean how do you create an instance of the Equilateral object, you simply don’t send it any values. See the very end.
I was wondering why is it necessary to add a “self” before the angle value instead of just using “self.angle1 = angle”, I know it returns an error but I can’t understand why.
Hi there. I typed in exactly what @ericgrossdesign provided (figured it out by myself), but it was not being accepted. It is saying: It looks like **init** () is missing from Equilateral AND/OR Triangle. class Equilateral(Triangle): angle = 60 def __init__(self): self.angle1 = self.angle self.angle2 = self.angle self.angle3 = self.angle
same issue here. the solution is exactly the same, except that I didn’t put parentheses for the if statement in check_angles()
EDIT: I replaced my code with the solution and the error still popped out… unable to proceed
I don’t see a solution to this issue, and I’m having the same problem.
I checked my spelling and indentation, and everything looks correct to my amateur eye.
Below is the code I wrote before I checked the forums:
The exercise wants us to create a class variable, angle, and set its value to 60. It then wants us to assign self.angle1, self.angle2, and self.angle3 equal to the class variable angle. While your solution does set all three angles to 60, the exercise wants us to set the three angles to a variable that holds the value 60. What change do you need to make?
I’ve created the variable, and set the angles to the angle, but I don’t think that was the cause of the “It looks like init () is missing from Equilateral AND/OR Triangle.” error.
I’ve tried placing the angle variable both in the init function and outside (the lessons show it outside) and I’ve tried using “self.angle1 = angle” and self.angle1 = self.angle" neither way works. Again, I think these are independent of the ‘init’ error I’m getting, which is making the other details harder to track.
Because angle is a class variable and not an instance variable, you should use self.angle1 = angle rather than self.angle1 = self.angle.
As for the error you’re getting, it might be because your declaration of the __init__ method in the Triangle class has a space between the method name and the opening bracket for the method arguments (should be def __init__(self, angle1, angle2, angle3), not def __init__ (self, angle1, angle2, angle)).
sorry to keep being a pest, but this is really annoying. The previous lessons passed, which were before adding the ‘Equilateral’ class. There isn’t anything different about the init in Equilateral that I can tell. I don’t know why I would suddenly get this error.
Sorry, my bad; earlier, I mentioned you should use self.angle1 = angle. Instead, it should be self.angle1 = self.angle or self.angle1 = Equilateral.angle. The following topic explains this.
If none of the above options work, try using the “Get Unstuck” button and accessing the solution. It seems like something may have gone wrong in terms of solution validation in this exercise.
I’ve had the same error message and the only way to move on is simply to replace my own code with the solution code (editing my own code to make it identical did not work)
Maybe try copying and pasting the solution code into the code editor and running the exercise? If the exercise still doesn’t let you pass, you can submit a bug report in either the Community: Bug Reporting category on the forums or in the “Submit a Bug Report” section when you click “Get Unstuck”.