Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

separate alphanumeric list

### START FUNCTION
def create_dictionary(character_list):
    dictionary={'numbers':[],'uppercase':[],'lowercase':[]}
    for character in character_list:
        try:
            int(character)
            dictionary['numbers'].append(character)
        except:
            if character.isupper():
                dictionary['uppercase'].append(character)
            elif character.islower():
                dictionary['lowercase'].append(character)
    for item in dictionary:
        dictionary[item].sort()
    return dictionary
### END FUNCTION
Comment

PREVIOUS NEXT
Code Example
Python :: "Token" is not defined Pylance 
Python :: def get_context_data(self, **kwargs): 
Python :: numpy online practice 
Python :: module django contrib admin has no attribute action ACTION_CHECKBOX_NAME 
Python :: pandas dtodays date csv 
Python :: variable types in python 
Python :: table is not creating in django 
Python :: list of thing same condition 
Python :: pandas read float numbers with coma 
Python :: type operator in python 
Python :: dictionary in python commands 
Python :: nlp generate parse tree in python 
Python :: pyjone location 
Python :: jet 4 access python password 
Python :: Print Odd Even Negative Integer Count 
Python :: python tags 
Python :: Pte or Pvt 
Python :: how to check if a list raises IndexError but wihing a if statement python 
Python :: numpy bitwise_or multiple images 
Python :: Create a new list from a list when a certain condition is met 
Python :: generate fibonacci series in python 
Python :: install matplotlib on nvidia jetson nx 
Python :: matplotlib FiveThirtyEight horizontal graph 
Python :: how to make a square multicolor square spiral python 
Python :: alberi binari di ricerca python 
Python :: mechanize python #6 
Python :: how to visualize pytorch model filters 
Python :: multiplication objects 
Python :: python concat list multiple times 
Python :: This code is supposed to display "2 "2 + 2 = 4"" on the screen, but there is an error. Find the error in the code and fix it, so that the output is correct. 
ADD CONTENT
Topic
Content
Source link
Name
2+1 =