把”0102030405”分成5组('0', '1'), ('0', '2'), ('0', '3'), ('0', '4'), ('0', '5')
re.findall(r"(\d)(\d)",s)
>>> re.findall(r"(\d)(\d)",s)
[('0', '1'), ('0', '2'), ('0', '3'), ('0', '4'), ('0', '5')]
把”0102030405”分成5组('0', '1'), ('0', '2'), ('0', '3'), ('0', '4'), ('0', '5')
re.findall(r"(\d)(\d)",s)
>>> re.findall(r"(\d)(\d)",s)
[('0', '1'), ('0', '2'), ('0', '3'), ('0', '4'), ('0', '5')]
转载于:https://www.cnblogs.com/xiaxiaoxu/p/9529187.html