translate replaces parts of a string, translate only works with single characters : translate « String « Python Tutorial






from string import maketrans
table = maketrans('cs', 'kz')
print 'this is a test'.translate(table)
5.37.translate
5.37.1.translate replaces parts of a string, translate only works with single characters