Método para la edad del formato en Python

def format_age(s):
    chars = list(s)  # list of characters
    digit_chars = [c for c in chars if c.isdigit()]
    return int("".join(digit_chars))
icy_milktea27