"Chris Castillo" <[email protected]> wrote


and I am trying to turn it into english with the following code:

def eng2leet(astring):
   astring = astring.replace("4","a")
   astring = astring.replace("8","b")
   astring = astring.replace("[","c")
   astring = astring.replace("|)","d")

You might want to investigate the maketrans and translate functions in the string module.

The seem to be quite similar in intent to what you are trying to do?

HTH,


--
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/

_______________________________________________
Tutor maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/tutor

Reply via email to