Sum ticket digits
Your task
An audit script fingerprints ticket IDs by summing the digit characters they contain. Given a string that may mix letters, digits, and punctuation, return the sum of all digit characters as a number. Return 0 if there are no digits. For example, 'ord-42x9' contains 4, 2, and 9, so the answer is 15.
Examples
digit_sum(s: str) -> intExample 1
Input
digit_sum("ord-42x9")Output
15