我正在學(xué)習(xí)流暢的python這本書,書里有串代碼importsysimportreWORD_RE=re.compile(r'w+')index={}withopen(sys.argv[1],encoding='utf-8')asfp:forline_no,lineinenumerate(fp,1):**formatchinWORD_RE.finditer(line):**word=match.group()我加粗的這段代碼,用到的finditer()方法只傳入了一個參數(shù),得到的是什么,pattern是有默認(rèn)值嗎?
求大佬指點哈!下面用到的函數(shù)只有一個參數(shù)?怎么回事哈???
回首憶惘然
2019-06-10 09:22:11