---
id: 68c7fecda6d210cc8f1960e8
title: Step 17
challengeType: 20
dashedName: step-17
---

# --description--

Finally, at the bottom of the `__init__` method, set the `_salary` attribute to the value corresponding to `level` inside the `_base_salaries` dictionary.

# --hints--

You should set `self._salary` to the value corresponding to `level` inside the `_base_salaries` dictionary

```js
({ test: () => runPython(`
  salaries = Employee._base_salaries
  assert len(salaries) > 0
  for level, salary in salaries.items():
    emp = Employee("Frank", level)
    assert emp._salary == salary    
`) })
```

# --seed--

## --seed-contents--

```py
class Employee:
    _base_salaries = {
        'trainee': 1000,
        'junior': 2000,
        'mid-level': 3000,
        'senior': 4000,
    }
--fcc-editable-region--
    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
        
--fcc-editable-region--
    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

charlie_brown = Employee('Charlie Brown', 'trainee')
print(charlie_brown)
```
