Search
 
SCRIPT & CODE EXAMPLE
 

TYPESCRIPT

how to separate a string into 2 lists of numbers and letters python

stringtosplit = 'hello75world'
letters = []
numbers = []
for k in stringtosplit:
    if k.isalpha() == True:
        letters.append(k)
    elif k.isdigit() == True:
        numbers.append(k)
letters = ''.join(letters)
numbers = ''.join(numbers)
print(numbers)
print(letters)
Comment

PREVIOUS NEXT
Code Example
Typescript :: fusion builder elegant elements for free 
Typescript :: importhtml google sheets multiple tables 
Typescript :: land features created by plates moving toward each other 
Typescript :: How to return a new string with its first and last characters swapped 
Typescript :: list all motherboard ports command line 
Typescript :: // running tests Your code should no longer have a p tag around the text asking what level ninja a user is. // tests completed category:423 
Cpp :: ue4 c++ print to screen 
Cpp :: latex piecewise function 
Cpp :: how to list environments with conda 
Cpp :: how to include everything in c++ 
Cpp :: cpp get data type 
Cpp :: vector erase not working c++ 
Cpp :: c++ hide cursor 
Cpp :: lpcwstr to string c++ 
Cpp :: log base c++ 
Cpp :: output coloured text in cpp 
Cpp :: c++std vector three elemet c++ 
Cpp :: swap using Function template in c++ 
Cpp :: find max value in image c++ 
Cpp :: how to calculate polar coordinates in c++ 
Cpp :: c++ writing to file 
Cpp :: tostring c++ 
Cpp :: how to use comparator funtion in priority queue in c++ 
Cpp :: taking user input for a vector in c++ 
Cpp :: if not defined c++ 
Cpp :: PI IN C++ WITH CMATH 
Cpp :: cpp float to int 
Cpp :: how to make a hello world program in c++ 
Cpp :: map defualt value c++ 
Cpp :: c++ string remove first character 
ADD CONTENT
Topic
Content
Source link
Name
6+4 =