Categories
How to cut a string into a list?
Hello. I asked myself one question: For example, I have a string "A729D2B91E1" How can I parse it into a list of this kind - ["A729", "D2", "B91", "E1"]?
Answer the question
In order to leave comments, you need to log in
import re a = 'A729D2B91E1' b = re.findall(r'[A-Z]\d+', a) print(b)
Didn't find what you were looking for?
Ask a Question
731 491 924 answers to any question