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 ... Python Interview Q&A Python Bootcamp Python Training ... The index() method finds the first occurrence of the specified value....
🌐
Python documentation
docs.python.org › 3 › library › stdtypes.html
Built-in Types — Python 3.14.6 documentation
Strings may also be created from other objects using the str constructor. Since there is no separate “character” type, indexing a string produces strings of length 1.
🌐
Stanford CS
cs.stanford.edu › people › nick › py › python-string.html
Python Strings
Similarly, if the start index is greater or equal to the end index, the slice is just the empty string. >>> s = 'Python' >>> s[2:999] 'thon' >>> s[3:2] # zero chars ''
🌐
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.
🌐
GeeksforGeeks
geeksforgeeks.org › python › python-string-index-method
Python String index() Method - GeeksforGeeks
May 2, 2025 - Explanation: index() method searches for the substring "prog" within "Python programming" and returns starting index 7. ... end (optional): The ending index for the search. If not provided, it defaults to the length of the string.
Find elsewhere
🌐
CodeHS
codehs.com › tutorial › 13725
Tutorial: Indexing Python Strings | CodeHS
Learn how to access specific items by indexing through Python strings.
🌐
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.
🌐
GeeksforGeeks
geeksforgeeks.org › python › python-string
Python String - GeeksforGeeks
Python does not have a separate character type. A single character is treated as a string of length one. Strings are commonly used for text handling and manipulation. Strings can be created using either single ('...') or double ("...") quotes. Both behave the same. ... Use triple quotes ('''...''' ) or ( """...""") for strings that span multiple lines. Newlines are preserved. ... Strings are indexed sequences.
Published   June 11, 2026
🌐
Programiz
programiz.com › python-programming › methods › string › index
Python String index()
The index() method returns the index of a substring inside the string (if found).
🌐
Tutorial Teacher
tutorialsteacher.com › python › string-index
Python string.index() Method (With Examples)
Regex in Python · Create GUI using Tkinter · Entity Framework Extensions - Boost EF Core 9 · Bulk Insert · Bulk Delete · Bulk Update · Bulk Merge · The index() method returns the index of the first occurence of a substring in the given string.
🌐
freeCodeCamp
forum.freecodecamp.org › python
String index beginner Python - Python - The freeCodeCamp Forum
April 30, 2020 - Could someone help me to figure out why the start index 7 and ending index 26 is True? Dont we count here from 0 ,then we wouldn`t get ‘7’ and ‘26’ indexes. A bit confused( # start parameter: 7 # "programming is easy to learn." string is searched result = text.endswith('learn.', 7) print(result) # Both start and end is provided # start: 7, end: 26 # "programming is easy" string is searched result = text.endswith('is', 7, 26) # Returns False print(result) result = text.endswith('easy', 7, ...
🌐
GitHub
gist.github.com › juanfdovilla › 74ce02e46855197b71ac2697ebe05283
Slicing and Indexing Strings in Python: A Comprehensive Guide · GitHub
Slicing and Indexing Strings in Python: A Comprehensive Guide · Raw · gistfile1.txt · This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
🌐
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.
🌐
Rollbar
rollbar.com › home › how to fix indexerror: string index out of range in python
How to Fix IndexError: string index out of range in Python | Rollbar
Traceback (most recent call last): File "test.py", line 2, in <module> print(my_string[5]) ~~~~~~~~~^^^ IndexError: string index out of range · The Python IndexError: string index out of range can be fixed by making sure any characters accessed in a string are within the range of the string.
Published   April 24, 2023
🌐
Python Tutorial
pythontutorial.net › home › python string methods › python string index()
Python String index(): Locating the Index of a Substring in a String
December 28, 2020 - In this tutorial, you'll learn how to use the Python string index() method to get the lowest index of a substring in a string.
🌐
Google
developers.google.com › google for education › python › python strings
Python Strings | Python Education | Google for Developers
Characters in a string can be accessed using the standard [ ] syntax, and like Java and C++, Python uses zero-based indexing, so if s is 'hello' s[1] is 'e'. If the index is out of bounds for the string, Python raises an error.
🌐
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?