Remove all characters other than alphabets from string | Function to remove special characters and store it in another variable ; Store only valid characters ; Driver code
def removeSpecialCharacter ( s ) : NEW_LINE INDENT t = " " NEW_LINE for i in s : NEW_LINE INDENT if ( i >= ' A ' and i <= ' Z ' ) or ( i >= ' a ' and i <= ' z ' ) : NEW_LINE INDENT t += i NEW_LINE DEDENT DEDENT print ( t ) NEW_LINE DEDENT s = " $ Gee * k ; s . . fo , ▁ r ' Ge ^ eks ? " NEW_LINE removeSpecialCharacter ( s ) NEW_LINE