Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Quick recap
4. Accessing string characters
Indexing and slicing


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.


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

Stuck? Here's a hint!

The tenth character has an index of 9.