Build a Salary Tracker - Step 19

Tell us what’s happening:

I am at the 19th step of the Build a Salary Tracker workshop seems that the f string that I need to print is not correct although the console does show it properly

Here is the full code:
class Employee:
_base_salaries = {
‘trainee’: 1000,
‘junior’: 2000,
‘mid-level’: 3000,
‘senior’: 4000,
}

def __init__(self, name, level):
    if not (isinstance(name, str) and isinstance(level, str)):
        raise TypeError("'name' and 'level' attribute must

Your code so far

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

    def __init__(self, name, level):
        if not (isinstance(name, str) and isinstance(level, str)):
            raise TypeError("'name' and 'level' attribute must be of type 'str'.")
        if level not in Employee._base_salaries:
            raise ValueError(f"Invalid value '{level}' for 'level' attribute.")
        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

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

    @property
    def salary(self):
        return self._salary

# User Editable Region

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

# User Editable Region

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/143.0.0.0 Safari/537.36 Edg/143.0.0.0

Challenge Information:

Build a Salary Tracker - Step 19

Do you remember what the underscore means here?

thanks for the reminder

1 Like