---
id: 694bf6eb530e19a9c48c59f7
title: Step 18
challengeType: 20
dashedName: step-18
---

# --description--

You can also use negative numbers to slice from the end of a string. For example, `-1` refers to the last character, `-2` refers to the second-to-last character, and so on.

To get the last three characters of a string, you can use `string[-3:]`. Note how the stop parameter is omitted after the colon. This means the slicing should proceed up to the string boundary.

Create a variable named `last_three`. Use negative indexing to extract the last three characters from `employee_code` (which represent the ID number). Finally, print `last_three` to the terminal.

With that, the employee card workshop is complete.

# --hints--

You should have a variable named `last_three`.

```js
({ test: () => assert(runPython(`_Node(_code).has_variable("last_three")`)) })
```

You should slice the last three characters of `employee_code` using negative indexing and assign them your `last_three` variable.

```js
({ test: () => assert(runPython(`_Node(_code).find_variable("last_three").is_equivalent("last_three = employee_code[-3:]")`)) })
```

You should print `last_three` to the terminal.

```js
({ test: () => assert(runPython(`_Node(_code).has_call("print(last_three)")`)) })
```

# --seed--

## --seed-contents--

```python
first_name = 'John'
last_name = 'Doe'
full_name = first_name + ' ' + last_name
address = '123 Main Street'
address += ', Apartment 4B'
employee_age = 28
employee_info = full_name + ' is ' + str(employee_age) + ' years old'
print(employee_info)
experience_years = 5
experience_info = 'Experience: ' + str(experience_years) + ' years'
print(experience_info)
position = 'Data Analyst'
salary = 75000
employee_card = f'Employee: {full_name} | Age: {employee_age} | Position: {position} | Salary: ${salary}'
print(employee_card)
employee_code = 'DEV-2026-JD-001'
department = employee_code[0:3]
print(department)
year_code = employee_code[4:8]
print(year_code)
initials = employee_code[9:11]
print(initials)
--fcc-editable-region--

--fcc-editable-region--
```

# --solutions--

```python
first_name = 'John'
last_name = 'Doe'
full_name = first_name + ' ' + last_name
address = '123 Main Street'
address += ', Apartment 4B'
employee_age = 28
employee_info = full_name + ' is ' + str(employee_age) + ' years old'
print(employee_info)
experience_years = 5
experience_info = 'Experience: ' + str(experience_years) + ' years'
print(experience_info)
position = 'Data Analyst'
salary = 75000
employee_card = f'Employee: {full_name} | Age: {employee_age} | Position: {position} | Salary: ${salary}'
print(employee_card)
employee_code = 'DEV-2026-JD-001'
department = employee_code[0:3]
print(department)
year_code = employee_code[4:8]
initials = employee_code[9:11]
print(year_code)
print(initials)
last_three = employee_code[-3:]
print(last_three)
```
