"""File: del_char.py Purpose: Implement a function that removes all occurrences of a specified character from a string Run: python del_char.py Input: A string and a character to delete from the string Output: The original string and the string with the character deleted """ def del_char(c, s): """Remove all occurrences of c from the string s""" t = "" # Empty string for let in s: if let != c: t = t + let return t #---------------------------------------------------------------------- s = raw_input("Enter a string\n ") c = raw_input("Enter a letter\n ") s_new = del_char(c, s) print "After removing all occurrences of", c, "from", s, "we have", s_new