Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

How to separate characters, Numbers and Special characters from given string with python

# Python 3 program to split an alphanumeric
# string using STL
def splitString(str):
    upper = ""
    lower = ""
    num = ""
    special = ""
    for i in range(len(str)):
        if (str[i].isdigit()):
            num = num + str[i]
        elif (str[i] >= 'A' and str[i] <= 'Z'):
            upper = upper + str[i]
        elif (str[i] >= 'a' and str[i] <= 'z'):
            lower += str[i]
        else:
            special += str[i]

    print(upper)
    print(lower)
    print(num)
    print(special)

splitString(input("Type: "))
Comment

PREVIOUS NEXT
Code Example
Python :: python yield async awiat 
Python :: django not configured pylint error fix 
Python :: gensim word2vec loop keyed vector 
Python :: from django.urls import reverse 
Python :: paginate @registrations 
Python :: python backtest 
Python :: python convert string object to int object 
Python :: Send Variable Over In Python Views 
Python :: Reading CSV delimited format 
Python :: get database image in dajngo 
Python :: hashmap in python 
Python :: python is not operator 
Python :: manim replacement transform 
Python :: checking time in time range 
Python :: python find occurance of item 
Python :: Dizideki en son elemani alma 
Python :: django queryset or operator 
Python :: webhook logger python 
Python :: how to preserve white space when joining an array python 
Python :: how to loop through glob.iglob iterator 
Python :: how to change a kivy button text in kivy lang from python file 
Python :: python pywin32 get current cursor row 
Python :: how to count to 1billion in python 
Python :: python site-packages pyspark 
Python :: python itérer dictionnaire 
Python :: how to vreate a list in python 
Python :: what does math.acos do in python 
Python :: send2trash 
Python :: Complete the function that accepts a string parameter, and reverses each word in the string. All spaces in the string should be retained. 
Python :: Connection to Python debugger failed: Interrupted function call: accept failed 
ADD CONTENT
Topic
Content
Source link
Name
8+8 =