Assuming your string is s:

'$' in s        # found
'$' not in s    # not found

# original answer given, but less Pythonic than the above...
s.find('$')==-1 # not found
s.find('$')!=-1 # found

And so on for other characters.

... or

pattern = re.compile(r'[\d\$,]')
if pattern.findall(s):
    print('Found')
else:
    print('Not found')

... or

chars = set('0123456789$,')
if any((c in chars) for c in s):
    print('Found')
else:
    print('Not Found')
Answer from dappawit on Stack Overflow
🌐
GeeksforGeeks
geeksforgeeks.org › python › python-check-if-string-contains-character
Check if string contains character - Python - GeeksforGeeks
July 23, 2025 - Explanation: The in operator is used to test membership, returning True if "e" is present in the string, and False otherwise. If found, it prints "Character found!", otherwise, it prints "Character not found!".
🌐
Reddit
reddit.com › r/learnpython › how can you check if a string contains any one character from a set of characters?
r/learnpython on Reddit: How can you check if a string contains any one character from a set of characters?
May 24, 2022 -

Is there some easy, built-in way to check if a given string contains at least one single digit, 0-9? Everything I'm searching talks about the in operator or the find method, but those seem to require that you already know which digit you are looking for.

I'm leaning toward using an RE, but I wanted to know if there was a simpler way first.

Examples that would evaluate to true would be:

'44 a b'
'aa ba 5'
'45 187'

and false would be any string without at least one digit.

I figure I can just try to match it with \d+, but I don't want to rely on REs too much, even though I find them fun!

Thanks!

🌐
O'Reilly
oreilly.com › library › view › python-cookbook › 0596001673 › ch03s07.html
Checking Whether a String Contains a Set of Characters - Python Cookbook [Book]
July 19, 2002 - The solution generalizes to any sequence (not just a string), and any set (any object in which membership can be tested with the in operator, not just one of characters): def containsAny(str, set): """ Check whether sequence str contains ANY of the items in set.
Authors: Alex MartelliDavid Ascher
Published: 2002
Pages: 608
🌐
Quora
quora.com › How-do-I-check-if-a-string-contains-a-character-in-Python
How to check if a string contains a character in Python - Quora
Quora is a place to gain and share knowledge. It's a platform to ask questions and connect with people who contribute unique insights and quality answers.
🌐
Reddit
reddit.com › r/learnpython › how to check if a string contains a character in a list
r/learnpython on Reddit: How to check if a string contains a character in a list
February 19, 2022 -

I'm really new to python and i'm having some trouble figuring out how to check if a list contains a certain character.

For example:
list = ['a1', 'a2', 'b1', 'b2', 'a3', 'a5', 'c3']

how would I check to see what elements contain the string 'a'? sorry if i didn't word my question properly i'm still very new to coding, but any help would be appreciated.

🌐
Codingem
codingem.com › home › python how to check if string contains characters from a list
Python How to Check If String Contains Characters from a List - codingem.com
October 12, 2022 - Check if a character is in the target string. Add the truth to a list. Check if all truth values in a list are True. ... chars = ["H", "e", "y"] word = "Hello" truths = [] # 1. Loop through the chars for char in chars: # 2. Check if a character is in the target string truth = char in word # 3.
🌐
LearnDataSci
learndatasci.com › solutions › python-string-contains
Python String Contains – See if String Contains a Substring – LearnDataSci
Of the three options listed in this article, using if ... in is usually the best approach for seeing if a string contains a substring. Remember that the simplest solution is quite often the best one! Another option you've got for searching a string is using the find() method. If the argument we provide find() exists in a string, then the function will return the start location index of the substring we're looking for. If not, then the function will return -1. The image below shows how string characters are assigned indexes:
Find elsewhere
🌐
Javatpoint
javatpoint.com › check-if-string-has-character-in-python
Check if String has Character in Python - Javatpoint
Check if String has Character in Python with tutorial, tkinter, button, overview, canvas, frame, environment set-up, first python program, etc.
🌐
Real Python
realpython.com › python-string-contains-substring
How to Check if a Python String Contains a Substring – Real Python
September 10, 2025 - You may only want to match occurrences of your substring followed by punctuation, or identify words that contain the substring plus other letters, such as "secretly". For such cases that require more involved string matching, you can use regular expressions, or regex, with Python’s re module. For example, if you want to find all the words that start with "secret" but are then followed by at least one additional letter, then you can use the regex word character (\w) followed by the plus quantifier (+):
🌐
Replit
replit.com › home › discover › how to check if a string contains certain characters in python
How to Check a String for Characters in Python | Replit
April 14, 2026 - Learn how to check if a Python string contains certain characters. We cover methods, tips, real-world uses, and common error debugging.
🌐
Codecademy
codecademy.com › article › how-to-check-if-a-string-contains-a-substring-in-python
How to Check if a String Contains a Substring in Python | Codecademy
The performance is generally similar for small strings, but in is often preferred over .find() for readability and simplicity. ... 'The Codecademy Team, composed of experienced educators and tech experts, is dedicated to making tech skills accessible to all. We empower learners worldwide with expert-reviewed content that develops and enhances the technical skills needed to advance and succeed in their careers.'Meet the full team ... Learn how to remove characters from a Python string using `rstrip()`, `replace()`, and `re.sub()` with examples.
🌐
AskPython
askpython.com › python › string › python-string-contains
Python String contains: Check if String Contains Substring - AskPython
April 27, 2023 - Let’s look at some examples of ... in Python. str = "Hello World!" sub_str = "World" if (str.__contains__(sub_str)): print("String contains Substring") else: print("String does not contain Substring") Here we have specified a string, and then a substring, both containing some character, and then ...
🌐
DataCamp
datacamp.com › tutorial › python-string-contains
Python String Search and Replace: in, .find(), .index(), .count(), and .replace() | DataCamp
March 31, 2026 - Python’s text strings are Unicode. Substring operations are case-sensitive by default and implemented in C for speed. The most direct way to test if text appears inside a string is the in operator, which returns a Boolean using the string’s __contains__() implementation.
🌐
Udemy
blog.udemy.com › home › it & development › software development › the many ways to check if a python string contains a substring
Ways to Check if a Python String Contains a Substring - Udemy Blog
April 14, 2026 - The python str class has a __contains__() method that will check if a python string contains a substring. It will return true if it’s found and will return false if it’s not. You will notice that the method name is wrapped in two underscores.
🌐
TutorialsPoint
tutorialspoint.com › how-to-check-if-a-string-only-contains-certain-characters-in-python
How to check if a string only contains certain characters in Python?
September 2, 2025 - The given string is: 1234654185 Checking if it contains only {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'} True The given string is: 12346@ Checking if it contains only {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'} False · The re.fullmatch() function from the re module checks if the entire string matches a specific pattern of allowed characters.
🌐
EyeHunts
tutorial.eyehunts.com › home › python string contains character
Python string contains the character
April 8, 2024 - The easiest way to check if a Python string contains a character is to use the in operator. It returns a Boolean (either True or False)...
🌐
DigitalOcean
digitalocean.com › community › tutorials › python-string-contains
Python String contains | DigitalOcean
Learn how to check if one Python string contains another using the contains () method. This case-sensitive instance method returns True or False based on …