On Tue, Oct 20, 2009 at 3:38 PM, Sidharth Kuruvila < sidharth.kuruv...@gmail.com> wrote:
> Hi, > Blargh! Boy! Read the mails! That code you wrote runs fine on 2.6. > But won't run on 3.0. > > This should work. > > intab = "aeiou" > outtab = "12345" > trantab = str.maketrans(intab,outtab) #Watch this line! > st = "this is string example....wow!!!"; > print(st.translate(trantab)) > > Basically they've moved maketrans from string to str. > Moral of story: Don't use functions on string module, use them on the string object. Using "string.<...>" is bad coding in Python. > > Regards, > Sidharth > > > -- --Anand
_______________________________________________ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers