All pastes #152912 Raw Edit

Marc

public python v1 · immutable
#152912 ·published 2006-08-29 08:06 UTC
rendered paste body
import stringalphamap = dict((c,m + 1) for m,c in enumerate(string.lowercase))nummap   = dict((m + 1,c) for m,c in enumerate(string.lowercase))def encnum(texto):        # Make it lowercase        texto = texto.lower()        # Iterate through a-z        for l in alphamap.keys():                # replace a-z with 1-26                texto = texto.replace(l, " " + str(alphamap[l]))        return textoprint encnum("abcdef")# Output is  1 2 3 4 5 6