Please don't mark this question as duplicate as I have already seen the other questionSum of digits
Well, I have a following code
string = "2x83u0x7u8i9lkueieueue8"
numeric = lambda x: int(x) if x.isdigit() else 0
print reduce(lambda x, y: x + numeric(y), string , 0)
The answer should be 2 + 83 + 0 + 7 + 8 + 9 + 8 = 117 and not 45