I want to write this code in more pythonic way. Have you any idea how I can do this?
def counter():
for x in self.get_xs():
total_x = 0
result = (re.sub('[^0-9]', '', x))
for number in result:
total_x += int(number)
yield(total_x)
resultcame from? Perhaps you meant:re.sub('[^0-9]', '', x).