this wont work in codewrite when i import 're' is there another way?

Example 'aa1aa2aa3' should change to 'aadaadaad'


Code:
st = raw_input("Enter string: ")

def discover_digits(st):

....import re
....digit = re.sub('\d', 'd', 'aa1aa2aa3') # \d means  \   .........any digit
....print digit
....return digit

discover_digits(st)