Build a salary tracker step 31

I have 3 if statement in my level setter but when I hit the check your code button I am geeting the following error: ,.You should have a third if statement”. more than that I lost the history of my Course progress which is really bad. I was enjoying the python course but now I can’t move forward. Just to mention that I am not a beginner and I am senior developer. That means the issues I am facing are related to the stability of the freeCodeCamp plattform. All the progress I made is lost :enraged_face:

class Employee:
    _base_salaries = {
        'trainee': 1000,
        'junior': 2000,
        'mid-level': 3000,
        'senior': 4000,
    }

    def __init__(self, name, level):
        self.name = name
        self.level = level
        self._salary = Employee._base_salaries[level]

    def __str__(self):
        return f'{self.name}: {self.level}'

    def __repr__(self):
        return f"Employee('{self.name}', '{self.level}')"

    @property
    def name(self):
        return self._name

    @name.setter
    def name(self, new_name):
        if not isinstance(new_name, str):
            raise TypeError("'name' must be a string.")
        self._name = new_name
        print(f"'name' updated to '{self.name}'.")

    @property
    def level(self):
        return self._level

    @level.setter
    def level(self, new_level):
        if not isinstance(new_level, str):
            raise TypeError("'level' must be a string.")

        if new_level not in Employee._base_salaries:
            raise ValueError(f"Invalid value '{new_level}' for 'level' attribute")

        if hasattr(self, '_level') and new_level == self.level:
            raise ValueError(f"'{self.level}' is already the selected level.")

        self._level = new_level
    
    @property
    def salary(self):
        return self._salary

charlie_brown = Employee('Charlie Brown', 'trainee')
print(charlie_brown)
print(f'Base salary: ${charlie_brown.salary}')
charlie_brown.level= 'trainee'

Welcome to the forum @mazan_abdelkader!

Please provide a link to the challenge you are working on. Thank you.

In the future, if you need help, just click the “Help” button. The “Help” button will package up your code and send it along with a link to the challenge.

Happy coding!

As mentioned in the code I provided for Build a salary tracker step 31. it is working, but it seems that you are expecting the solution in defined order or something like that. I tested my code and it is delivering the expected result

When I plugged in just the code for this step, the tests pass; but when I copy all of your code and test, the tests fail. That tells me that you may have inadvertently changed something in the starting code, which will cause the tests to fail.

Please reset and try again.

Happy coding!

The issue was that i tyried to test the last if statement: charlie_brown.level= ‘trainee’. Really strange. After removing this line the code is working

you created an error with that, the tests are unable to say where the error comes from and fail

for your

are you sure you are logged in in the same account?