Use the rstrip() method Example >>> name = ' Steve ' >>> name ' Steve ' >>> name = name.rstrip() >>> name ' Steve'