Spring Deals - hours only!Up to 70% off on all courses and bundles.-Close
Introduction
Quick recap
4. Accessing string characters
Indexing and slicing
Summary

Instruction

Perfect. To access a specific character in a string, use square brackets:

secret_password = 'jhk7GSH8ds'
print('Password hint: the third letter of your password is ' + secret_password[2])

To access the third character in this string, you'd use

secret_password[2] # not [3]!
This is because character indices start at 0.

Exercise

Take a look at the template code. Print the tenth character.

Stuck? Here's a hint!

The tenth character has an index of 9.