>>> import re >>> re.sub('D', '', 'aas30dsa20') '3020'
def AdvancedIn(in_string): res = ''.join(i for i in input(in_string) if i.isdigit()) return res