Introduction
Quick recap
Indexing and slicing
15. Index out of range
Summary

Instruction

Good job! Let's do one final experiment with string indices. What happens when you try to access a non-existent element?

Exercise

Take a look at the template code. Try to access an element that is not present in the string.

For instance, try first_letters[7] or first_letters[-9].

In both cases, we get an IndexError: string index out of range. That's not a problem when we're testing things, but when your users encounter this, their programs will stop working (crash)!

When you're done, click Next exercise to continue.