An optional second argument can be supplied to translate, specifying letters that should be deleted : maketrans « String « Python Tutorial






from string import maketrans
table = maketrans('cs', 'kz')

print 'this is an incredible test'.translate(table, ' ')
5.18.maketrans
5.18.1.An optional second argument can be supplied to translate, specifying letters that should be deleted