Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

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)
Comment

PREVIOUS NEXT
Code Example
Python :: importing python modules from a folder 
Python :: class in python 
Python :: quick sort algorithm in python 
Python :: python check if string is float 
Python :: Example pandas.read_hfd5() 
Python :: PySimple list of elements 
Python :: migrations.RunPython 
Python :: python get time executed by function 
Python :: how to parse http request in python 
Python :: Reversing Ints 
Python :: Python RegEx SubString – re.sub() 
Python :: sqlite database python 
Python :: turtle python screen border 
Python :: set comprehension 
Python :: python remove white space 
Python :: how to insert values to database with using dictionary in python 
Python :: Get text without inner tags text in selenium 
Python :: requesting with aiohttp 
Python :: get resolution of image python 
Python :: subscriptable meaning in python 
Python :: # Python string capitalization 
Python :: remove occurence of character from string python 
Python :: how to step or only print every two element of list python 
Python :: hierarchy dendrogram 
Python :: reshape IML matrix 
Python :: block content 
Python :: mongodb and python 
Python :: convert list to dataset python 
Python :: django swagger 
Python :: python date time 
ADD CONTENT
Topic
Content
Source link
Name
3+2 =