Special characters are non-alphabetic or non-numeric characters. They are often part of string. To remove special characters from string, we can use
Using a loop, iterate through each character in a string. In a conditional statement, using
str.isalnum(), check whether character is alphanumeric or not. Add each alphanumeric character to a new string. Then the new string will be free of special characters.
a = "Python @ point! #*" new = "" print(a) for character in a: if character.isalnum(): new += character print(new)
Python @ point! #* Pythonpoint