Hi folks,

I'm trying to do something like this:

>>> evildict= {'good' : 'bad' , 'love' : 'hate' , 'God': 'Satan'}

>>> def make_evil(text)
...        for a in evildict:
...              text=text.replace(a, evildict[a])
...              return text
    

This works fine, but it soon gets too slow as the size of text and dictionary 
begin to grow.
Can you guys suggest me a way to make it faster?



      Devenez un meilleur amigo grâce à Yahoo! Courriel
http://cf.promos.yahoo.com/courriel/visiteguidee2/
_______________________________________________
Tutor maillist  -  [email protected]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to