import retest_str = "2890191245"print(re.sub("(?<=\d)(?=(\d{3})+$)", ",", test_str).split(","))
Standard input is empty
['2', '890', '191', '245']
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!