Here is another solution:

import re
my_list= ["on@3", "two#", "thre%e"]
print [re.sub('[^a-zA-Z0-9]+', '', _) for _ in my_list]

output:

['on3', 'two', 'three']
Answer from Mahesh Karia on Stack Overflow
🌐
Know Program
knowprogram.com › home › remove special characters from list python
Remove Special Characters From list Python - Know Program
April 29, 2021 - We are using the join() method to remove special characters. In the generator function, we specify the logic to ignore the characters in special_char and hence constructing out_list free from special characters.
🌐
GeeksforGeeks
geeksforgeeks.org › python › python-remove-trailing-leading-special-characters-from-strings-list
Python | Remove trailing/leading special characters from strings list - GeeksforGeeks
May 16, 2023 - In this, we employ strip(), which has the ability to remove the trailing and leading special unwanted characters from string list. The map(), is used to extend the logic to each element in list.
🌐
Scaler
scaler.com › home › topics › remove special characters from string python
Remove Special Characters From String Python - Scaler Topics
January 6, 2024 - The sample_list is a list of normal characters selected by using the isalnum() function. ... Scaler learners achieved 2.5x salary growth with average post-Scaler CTC reaching ₹23L. ... The replace() method in python can be used to remove specified special characters from the string.
Top answer
1 of 2
3

If you want to remove all non-letters chars, try:

words = ["".join(filter(lambda c: c.isalpha(), word)) for word in words]
print(words)
2 of 2
2

You can use built in shortcuts rather than have to specify all of the special characters. Here's a way to remove everything but "word characters":

import re

inp = ['rt', '@', 'dark', 'money', 'has', 'played', 'a', '#significant', 'role', 'in', 'tRhe', 'overall', 'increase', 'of', 'election', 'spending', 'in', 'state', 'judicial', 'elections.', 'https://e85zq', 'rt', '@', 'notice,', 'women,', 'how', 'you', 'are', 'always', 'the', 'target', 'of', 'democrats’', 'fear', 'mongering', 'in', 'an', 'election', 'year', 'or', 'scotus', 'confirmation.', 'it', 'is', 'not', 'because', 'our', 'rights', 'are', 'actually', 'at', 'risk.', 'it', 'is', 'because', 'we', 'are', 'easily', 'manipulated.', 'goes', 'allll', 'the', 'way', 'back', 'to', 'eve.', 'resist', 'hysteria', '&', 'think.', 'rt', '@', 'oct', '5:', 'last', 'day', 'to', 'register', 'to', 'vote.', 'oct', '13:', 'early', 'voting', 'starts.', 'oct', '23:', 'last', 'day', 'to', 'request', 'a', 'mail-in', 'ballot.', 'nov', '3:', 'election', 'day', 'rt', '@']

outp = [re.sub(r"[^A-Za-z]+", '', s) for s in inp]

print(outp)

Result:

['rt', '', 'dark', 'money', 'has', 'played', 'a', 'significant', 'role', 'in', 'tRhe', 'overall', 'increase', 'of', 'election', 'spending', 'in', 'state', 'judicial', 'elections', 'httpse85zq', 'rt', '', 'notice', 'women', 'how', 'you', 'are', 'always', 'the', 'target', 'of', 'democrats', 'fear', 'mongering', 'in', 'an', 'election', 'year', 'or', 'scotus', 'confirmation', 'it', 'is', 'not', 'because', 'our', 'rights', 'are', 'actually', 'at', 'risk', 'it', 'is', 'because', 'we', 'are', 'easily', 'manipulated', 'goes', 'allll', 'the', 'way', 'back', 'to', 'eve', 'resist', 'hysteria', 'amp', 'think', 'rt', '', 'oct', '5', 'last', 'day', 'to', 'register', 'to', 'vote', 'oct', '13', 'early', 'voting', 'starts', 'oct', '23', 'last', 'day', 'to', 'request', 'a', 'mailin', 'ballot', 'nov', '3', 'election', 'day', 'rt', '']

The ^ character here means match everything NOT mentioned in the set of characters that follow inside a [] pair. \w means "word characters" . So the whole thing says "match everything but word characters." The nice thing about using a regular expression is that you can get arbitrarily precise as to just which characters you want to include or exclude.

No need to slice the result with [:100 to print it. Just print it as is, like I do. I assume that by using 100, you're wanting to make sure you go to the end of the list. The better way to do that is to just leave that component blank. So [:] means "take a slice of the string that is the full string", and [5:] means "take from the 6th character to the end of the string".

UPDATE: I just noticed that you said you don't want numbers in the result. So then I guess you just want letters. I changed the expression to do that. This is what's nice about a regular expression. You can tweak just what gets replaced without adding additional calls, loops, etc. but rather just change a string value.

🌐
GeeksforGeeks
geeksforgeeks.org › python › python-removing-unwanted-characters-from-string
Remove Special Characters from String in Python - GeeksforGeeks
July 11, 2025 - This method is both Pythonic and easy to understand, with good performance on medium-sized strings. ... Explanation: list comprehension iterate through each character in the string s and includes only those that are alphanumeric using char.isalnum(). The join() function then combines these characters into a new string. translate() method removes or replaces specific characters in a string based on a translation table.
Find elsewhere
🌐
Python Forum
python-forum.io › thread-13868.html
Remove special character from list
Hi guys, if I would to put ' symbol in the symbols, it is obvious that I won't be getting the desire outcome. I would like to preserve the ' symbol on don't isn't and wouldn't. I've tried with endswith method but still got it wrong. Hope you could h...
🌐
Delft Stack
delftstack.com › home › howto › python › remove special characters from string python
How to Remove Special Characters From the String in Python | Delft Stack
February 2, 2024 - This method applies the translation table and returns a new string with the specified character substitutions or removals. The map() function is a built-in Python function that applies a given function to each item of an iterable (e.g., a list, tuple, or string) and returns an iterator. When combined with a lambda function, map() can be a concise and efficient way to perform element-wise operations on a collection. # Example string with special characters original_string = "Hey!
🌐
Medium
medium.com › @ryan_forrester_ › remove-special-characters-from-strings-in-python-complete-guide-53651c8163d9
Remove Special Characters from Strings in Python: Complete Guide | by ryan | Medium
January 7, 2025 - Python strings often come with unwanted special characters — whether you’re cleaning up user input, processing text files, or handling data from an API. Let’s look at several practical methods to clean up these strings, with clear examples and real-world applications. The simplest way to remove specific special characters is with Python’s built-in string methods.
🌐
datagy
datagy.io › home › python posts › python strings › python: remove special characters from a string
Python: Remove Special Characters from a String • datagy
December 17, 2022 - Python has a special string method, .isalnum(), which returns True if the string is an alpha-numeric character and returns False if it is not. We can use this, to loop over a string and append, to a new string, only alpha-numeric characters. ... # Remove Special Characters from a String Using .isalnum() text = 'datagy -- is.
🌐
DigitalOcean
digitalocean.com › community › tutorials › python-remove-character-from-string
How to Remove Characters from a String in Python | DigitalOcean
May 31, 2026 - Use str.replace() for a single character or substring, str.translate() or str.maketrans() to drop several characters in one pass, re.sub() for pattern-based removal, and slicing when you need to remove characters at the start, end, or a fixed index. This tutorial walks through each approach ...
🌐
Stack Overflow
stackoverflow.com › questions › 79936126 › how-to-remove-items-from-a-list-that-contain-special-characters-while-iterating
python - How to remove items from a list that contain special characters while iterating - Stack Overflow
Let's say I have a list called words that contains some items with special characters (anything not alphanumerical). for i in words: #check if i contains special characters and return True or False #if True, remove i from words
🌐
PyTutorial
pytutorial.com › remove-special-characters-from-string-in-python
PyTutorial | Remove Special Characters from String in Python
February 23, 2026 - You loop through each character you want to remove. # Define a string with special characters text = "Hello, World! This #data needs $cleaning@2024." print("Original String:", text) # List of special characters to remove special_chars = [',', '!', '#', '$', '@'] # Loop through each character and replace it for char in special_chars: text = text.replace(char, '') print("Cleaned String:", text)
🌐
Quora
quora.com › How-do-I-remove-all-special-characters-in-a-string-in-Python
How to remove all special characters in a string in Python - Quora
Answer (1 of 5): There are numerous ways to accomplish this. To remove, say, all the a’s from a string, one can use the replace() string method: [code]>>> s = 'A man, a plan, a canal: Panama' >>> s = s.replace('a', '') >>> s 'A mn, pln, cnl: Pnm' [/code]One could also “explode” the string ...
🌐
freeCodeCamp
freecodecamp.org › news › how-to-remove-a-specific-character-from-a-string-in-python
How to Remove a Specific Character from a String in Python
December 7, 2022 - Python!?" replacements = [('!', ''), ('?', '')] for char, replacement in replacements: if char in my_string: my_string = my_string.replace(char, replacement) print(my_string) # output # Hi I love Python · I first created a string that contains the two characters I want to remove, ! and ?, and stored it in the variable my_string. I stored the characters I want to replace, along with their replacements, in a list of tuples with the name replacements - I want to replace !