You just need to index the string, just like you do with a list.

>>> 'hello'[3]
l

Note that Python indices (like most other languages) are zero based, so the first element is index 0, the second is index 1, etc.

For example:

>>> 'hello'[0]
h
>>> 'hello'[1]
e
Answer from Volatility on Stack Overflow
🌐
W3Schools
w3schools.com › python › ref_string_index.asp
Python String index() Method
Remove List Duplicates Reverse ... Q&A Python Bootcamp Python Certificate Python Training ... The index() method finds the first occurrence of the specified value....
🌐
DigitalOcean
digitalocean.com › community › tutorials › how-to-index-and-slice-strings-in-python-3
How To Index and Slice Strings in Python | DigitalOcean
September 29, 2025 - For the string Sammy Shark! the index breakdown is like this: Character: S | a | m | m | y | | S | h | a | r | k | ! Positive: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 Negative: -12 | -11| -10| -9 | -8 | -7| -6 | -5 | -4 | -3 | -2 | -1 ... The fact that each character in a Python string has a corresponding index number allows us to access and manipulate strings in the same ways we can with other sequential data types.
🌐
Programiz
programiz.com › python-programming › methods › string › index
Python String index()
Become a certified Python programmer. Try Programiz PRO! ... The index() method returns the index of a substring inside the string (if found).
🌐
GeeksforGeeks
geeksforgeeks.org › python › how-to-index-and-slice-strings-in-python
How to Index and Slice Strings in Python? - GeeksforGeeks
July 15, 2025 - String Indexing allows us to access individual characters in a string. Python treats strings like lists where each character is assigned an index, starting from 0.
🌐
CodeHS
codehs.com › tutorial › 13725
Tutorial: Indexing Python Strings | CodeHS
Click on one of our programs below to get started coding in the sandbox! ... Learn how to access specific items by indexing through Python strings.
🌐
Codecademy
codecademy.com › learn › dacp-python-fundamentals › modules › dscp-python-strings › cheatsheet
Python Fundamentals: Python Strings Cheatsheet | Codecademy
In Python, the built-in len() function can be used to determine the length of an object. It can be used to compute the length of strings, lists, sets, and other countable objects.
🌐
GeeksforGeeks
geeksforgeeks.org › python › python-string-index-method
Python String index() Method - GeeksforGeeks
May 2, 2025 - The index() method in Python is used to find the position of a specified substring within a given string. It is similar to the find() method but raises a ValueError if the substring is not found, while find() returns -1. This can be helpful ...
Find elsewhere
🌐
Tutorialspoint
tutorialspoint.com › python › string_index.htm
Python String index() Method
The python string index() method is used to return the index of the input string where the substring is found. Basically, it helps us to find out if the specified substring is present in the input string.
🌐
Codecademy
codecademy.com › docs › python › strings › .index()
Python | Strings | .index() | Codecademy
November 1, 2021 - The .index() string method searches through a string variable for the occurrence of a pattern or a substring. If the substring is not found, a ValueError will be raised. ... Looking for an introduction to the theory behind programming?
🌐
UC Berkeley Statistics
stat.berkeley.edu › ~spector › extension › python › notes › node19.html
Indexing and Slicing
To extract a single character from a string, follow the string with the index of the desired character surrounded by square brackets ([ ]), remembering that the first character of a string has index zero. >>> what = 'This parrot is dead' >>> what[3] 's' >>> what[0] 'T' If the subscript you ...
🌐
Runestone Academy
runestone.academy › ns › books › published › thinkcspy › Strings › IndexOperatorWorkingwiththeCharactersofaString.html
9.4. Index Operator: Working with the Characters of a String — How to Think like a Computer Scientist: Interactive Edition
The indexing operator (Python uses square brackets to enclose the index) selects a single character from a string. The characters are accessed by their position or index value. For example, in the string shown below, the 14 characters are indexed left to right from postion 0 to position 13.
🌐
O'Reilly
oreilly.com › library › view › learn-programming-in › 9781789531947 › 6f7c08e0-e72b-402b-86fe-843ac3a8aa7e.xhtml
Indexing and slicing strings - Learn Programming in Python with Cody Jackson [Book]
November 29, 2018 - Indexing and slicing strings Python strings functionally operate the same as Python lists, which are basically C arrays (see the Lists section). Unlike C arrays, characters within... - Selection from Learn Programming in Python with Cody Jackson [Book]
Author   Cody Jackson
Published   2018
Pages   304
🌐
Real Python
realpython.com › videos › string-indexing
String Indexing (Video) – Real Python
Indexing allows you to access individual characters in a string directly by using a numeric value. String indexing is zero-based: the first character in the string has index 0, the next is 1, and so on.
Published   October 1, 2019
🌐
PythonForBeginners
pythonforbeginners.com › home › string indexing in python
String Indexing in Python - PythonForBeginners.com
January 9, 2022 - If we have an ordered sequence ... Indexing, we can access any element from an ordered sequence using the indices. In python, string indexing is zero based....
🌐
Tu-delft-dcc
tu-delft-dcc.github.io › Intro-to-Python-for-GIS › Instructor_notes › Day_1 › lesson_notes › B2_Vars_Types.html
Use an index to get a single character from a string. — Python essentials for GIS learners
We take a slice by using [start:stop], where start is replaced with the index of the first element we want and stop is replaced with the index of the element just after the last element we want. Mathematically, you might say that a slice selects [start:stop). The difference between stop and start is the slice’s length. Taking a slice does not change the contents of the original string. Instead, the slice is a copy of part of the original string. ... Nested functions are evaluated from the inside out, like in mathematics. Python thinks that upper- and lower-case letters are different, so Name and name are different variables.
🌐
Python.org
discuss.python.org › python help
Indexing operators and string elements - Python Help - Discussions on Python.org
July 12, 2021 - Hi. Can someone explain why I get an error - Can I use and indexing operator to modify a string element like below country = ‘Thailand’ country[-2] = ‘z’ Thanks
🌐
Linode
linode.com › docs › guides › how-to-slice-and-index-strings-in-python
How to Slice and Index Strings in Python | Linode Docs
January 28, 2022 - It is possible to access any character in a Python string using array-based indexing. Strings can also be manipulated and transformed using the built-in string methods and operations.
🌐
Pythonspot
pythonspot.com › string-index
python string index - Python Tutorial
Python hosting: Host, run, and code Python in the cloud! The function .index() returns the index (position) of a substring in a string (if found). Returns exception if not found. It’s case sensitive.