# File: strstrip.py # Changes case of characters in a string # # Matt Bishop, ECS 10, Fall 2012 # # 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 leadig and trailing white space from", prstr, "gives", transstr)