# File: strstrip.py # Changes case of characters in a string # # Matt Bishop, ECS 10, Spring 2014 # # instr = input("Enter a string: ") # put quotes around the string to show its boundaries when it is printed prstr = '"' + instr + '"' # # now strip the white space # transstr = '"' + instr.lstrip() + '"' print("Deleting the leading white space from", prstr, "gives", transstr) transstr = '"' + instr.rstrip() + '"' print("Deleting the trailing white space from", prstr, "gives", transstr) transstr = '"' + instr.strip() + '"' print("Deleting the leading and trailing white space from", prstr, "gives", transstr)