python get rid of last 2 character in string code example Example: python remove last part of string #Removing last three characters foo = foo[:-3]