def remove_i (s): '''Return a new string that is the same as s, but with all instances of the letter i removed.''' while s.count("i") > 0: # remove the next occurrence of "i" where = s.find("i") # remove the character at position "where" in "s". s = s[0:where] + s[where+1:] return s def main(): text = "Indiana Illinois" print(text) text = remove_i(text) print (text,"should be Indana Illnos") text = "" text = remove_i(text) print(text,"should be the empty string") text = "aa bb cc dd" text = remove_i(text) print(text,"should be aa bb cc dd") main()