- 1

Python re question

import re >>> curr = '1' >>> for each in range(30): ... match = re.findall("(\d)(\\1*)",curr) ... curr = "".join([str(len(k+y))+k for k,y in match]) ... >>> print len(curr) \\ 1,11,21,1211,111221, ... \\ 5808 In this program,what does the "(\d)(\\1*)" mean???

26th Apr 2017, 7:10 PM
고혁인
1 Respuesta
+ 8
I thought we got that covered ;) https://www.sololearn.com/discuss/344854/?ref=app
26th Apr 2017, 7:19 PM
Kuba Siekierzyński
Kuba Siekierzyński - avatar