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 a String Add Two Numbers · Python Examples Python Compiler Python Exercises Python Quiz Python Challenges Python Practice Problems Python Server Python Syllabus Python Study Plan Python Interview Q&A Python Bootcamp 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 - The third parameter specifies the stride, which refers to how many characters to move forward after the first character is retrieved from the string. So far, we have omitted the stride parameter, and Python defaults to the stride of 1, so that every character between two index numbers is retrieved. Let’s review the example above that prints out the substring “Shark”:
🌐
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 when we want to ensure that the substring exists in the string before proceeding.
🌐
CodeHS
codehs.com › tutorial › 13725
Tutorial: Indexing Python Strings | CodeHS
Learn how to access specific items by indexing through Python strings.
🌐
GeeksforGeeks
geeksforgeeks.org › python › how-to-index-and-slice-strings-in-python
How to Index and Slice Strings in Python? - GeeksforGeeks
July 15, 2025 - In this type of Indexing, we pass the Negative index(which we want to access) in square brackets. Here the index number starts from index number -1 (which denotes the last character of a string). Example 2 (Negative Indexing) :
🌐
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).
Find elsewhere
🌐
Python.org
discuss.python.org › python help
Add a `count` keyword to str.index and str.find to find the n-th occurence of an element in a string - Python Help - Discussions on Python.org
August 8, 2023 - Current signature: str.index(sub[, start[, end]]) New suggested signature: str.index(sub[, start[, end[, count]]]) Str.index returns the countth occurence. By default count is of course 1. EDIT: Removed getting the …
🌐
Real Python
realpython.com › videos › string-indexing
String Indexing (Video) – Real Python
String indexing in Python is zero-based, so the very first character in the string would have an index of 0, 00:30 and the next would be 1, and so on. The index of the last character will be the length of the string minus one.
Published   October 1, 2019
🌐
Hashnode
codingwithestefania.hashnode.dev › python-string-indexing-how-to-get-characters
Python String Indexing - How to Get Individual Characters
February 22, 2024 - It's completely valid to use a negative index, as long as it is in the valid range of indices for that string. Let's illustrate this with an example. Below you can see a diagram with the corresponding negative indices for each character of this string. But notice something curious... 🤔 · Now we start to count from right to left and we decrement the value by 1 as we move towards the left. This applies to all Python strings, so if you ever need to get the last character of a string, you can just index -1 and avoid making any complicated calculations with the string length.
🌐
PythonForBeginners
pythonforbeginners.com › home › string indexing in python
String Indexing in Python - PythonForBeginners.com
January 25, 2022 - Suppose that we have a string “PythonForBeginners” · Here, the index of the letter “P” is 0. The index of the letter “y” is 1. The index of letter ”t” is 2, The index of letter “h” is 3 and so on.
🌐
docs.python.org
docs.python.org › fr › 3 › library › string.html
string --- Common string operations — Documentation Python 3.14.6
Source code: Lib/string/__init__.py Chaînes constantes: Les constantes définies dans ce module sont : Custom string formatting: The built-in string class provides the ability to do complex variable...
🌐
Python
docs.python.org › 3 › library › string.html
string — Common string operations
If it is an integer, it represents the index of the positional argument in args; if it is a string, then it represents a named argument in kwargs. The args parameter is set to the list of positional arguments to vformat(), and the kwargs parameter is set to the dictionary of keyword arguments. For compound field names, these functions are only called for the first component of the field name; subsequent components are handled through normal attribute and indexing operations. So for example, the field expression ‘0.name’ would cause get_value() to be called with a key argument of 0.
🌐
Built In
builtin.com › software-engineering-perspectives › python-substring-indexof
5 Ways to Find the Index of a Substring in Python | Built In
The index() method in Python finds the first occurrence of a specific character or element in a string or list. If the character or element is found, its index value will be returned.
🌐
IONOS
ionos.com › digital guide › websites › web development › python string index
How to find the position of a substring with Python string index
January 23, 2024 - Index: ", string.find("Py")) else: print("Substring not included!")Python · In this example, if the substring isn’t found, there is a branch, just like when handling an exception.
🌐
Mzntech
mzntech.com › edu › python › ref_string_index.asp
Python String index() Method
Remove List Duplicates Reverse a String Add Two Numbers · Python Examples Python Compiler Python Exercises Python Quiz Python Server Python Syllabus Python Interview Q&A Python Bootcamp Python Certificate ... The index() method finds the first occurrence of the specified value.
🌐
Learn By Example
learnbyexample.org › python-string-index-method
Python String index() Method - Learn By Example
April 20, 2020 - S = 'Bob is a Developer at ABC' x = S.index('Manager') # Triggers ValueError: substring not found S = 'Bob is a Developer at ABC' x = S.find('Manager') print(x) # Prints -1
🌐
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.
🌐
Simplilearn
simplilearn.com › home › resources › software development › python index: mastering list indexing techniques
Python List index() Method Explained with Examples
3 weeks ago - The Python index() method helps you find the index position of an element or an item in a string of characters or a list of items.
Address   5851 Legacy Circle, 6th Floor, Plano, TX 75024 United States