Answers for "remove characters in a string except alphabets python"

0

remove alphabetic characters python

numeric_answer = filter(str.isdigit, original_string)
numeric_answer = "".join(numeric_answer)
Posted by: Guest on October-31-2020
0

str remove except alphabets

#take user input
String1 = input('Enter the String :')
#initialize empty String
String2 = ''
for i in String1:
    #check for alphabets
    if (ord(i) >= 65 and ord(i) <= 90) or (ord(i) >= 97 and ord(i) <= 122):
        #concatenate to empty string
        String2+=i
print('Alphabets in string are :' + String2)
Posted by: Guest on May-18-2021

Code answers related to "remove characters in a string except alphabets python"

Python Answers by Framework

Browse Popular Code Answers by Language