How to access a character in a string in Python

A string is an immutable sequence of characters. Characters can be accessed with string indexing.

Solution for How to access a character in a string in Python : You can use string indexing to access a character in a string Use the syntax string[i] to access the character at index i. String indexing begins at the index 0 for the first character, and therefore would have the index 2 for the third character.


how-to-access-a-character-in-a-string-in-python