xxxxxxxxxx
Use the strip() method and pass in the
characters you want to remove
>>> name = ' eve '
>>> name.strip('e')
' eve '
>>> name2 = 'eve'
>>> name2.strip('e')
'v'
>>> name3 = 'steve'
>>> name3.strip('e')
'stev'
xxxxxxxxxx
Use the rstrip() method and pass in the characters you want to
remove from the right
>>> name = 'eve'
>>> name.rstrip('e')
'ev'
xxxxxxxxxx
Use the lstrip() characters and pass in the characters
ypu want to remove (Only character at the left end will be removed)
>>> name = 'eve'
>>> name.lstrip('e')
've'