An optional second argument can be supplied to translate, specifying letters that should be deleted : Maketrans : String PYTHON TUTORIALS


PYTHON TUTORIALS » String » Maketrans »

 

An optional second argument can be supplied to translate, specifying letters that should be deleted


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

print 'this is an incredible test'.translate(table, ' ')



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON TUTORIALS

 Navioo String
» Maketrans