#coding=utf-8import stringimport restr='i have 300 yuan, you 234 234 give me 200 again, then i have 500 yuan'iList= re.findall(r"\d+",str)print "string:",strprint "total digit number:",len(iList)