我这前后加个字符,就很妙 :)

while True:
    try:
        res, n, s = '', '0123456789', ' ' + input() + ' '
        for i in range(len(s) - 1):
            res +=  s[i]
            if s[i] not in n and s[i + 1] in n or s[i] in n and s[i + 1] not in n:
                res += '*'
        print(res[1:])
    except:
        break