title: Python Function to return a list of common letters in first and last names
body: <p>Question: DO NOT USE SETS IN YOUR FUNCTION: Uses lists to return a list of the common letters in the first and last names (the intersection) Prompt user for first and last name and call the function with the first and last names as arguments and print the returned list.    </p>
  
  <p>I can't figure out why my program is just printing "No matches" even if there are letter matches. Anything helps! Thanks a bunch!</p>
  
  <p>Code so far:</p>
  
  <pre><code>import string
  
  def getCommonLetters(text1, text2):
  """ Take two strings and return a list of letters common to
      both strings."""
      text1List = text1.split()
      text2List = text2.split()
      for i in range(0, len(text1List)):
          text1List[i] = getCleanText(text1List[i])
      for i in range(0, len(text2List)):
          text2List[i] = getCleanText(text2List[i])
  
      outList = []
      for letter in text1List:
          if letter in text2List and letter not in outList:
             outList.append(letter)
      return outList
  
  def getCleanText(text):
  """Return letter in lower case stripped of whitespace and
  punctuation characters"""
      text = text.lower()
  
      badCharacters = string.whitespace + string.punctuation
      for character in badCharacters:
          text = text.replace(character, "")
      return text
  
  userText1  = raw_input("Enter your first name: ")
  userText2  = raw_input("Enter your last name: ")
  result     = getCommonLetters(userText1, userText2)
  numMatches = len(result)
  if numMatches == 0:
      print "No matches."
  else:
      print "Number of matches:", numMatches
  
  for letter in result:
      print letter
  </code></pre>