how to split a string by colon in python

import re
re.split('[-:]', a)

Here is what the above code is Doing:
1. We are using the re.split() function to split the string a.
2. The first parameter of the re.split() function is the pattern we want to split on.
3. The pattern we want to split on is ‘[-:]’. This means we want to split on a hyphen or a colon.
4. The output of the code is [’12’, ’34’, ’56’].