title: Getting the Middle Name in a list
body: <p>I want to create a function that removes all of the middle name and leaves the First and Last name when given the format First, Middle, Last.</p>
  <p>So far, I have</p>
  <pre><code>def clearmidname(listnames):
      
      for name in listnames:
          name = name.split()
          del name[1]
          new = &quot; &quot;.join(name)
  
      return new
  </code></pre>
  <p>For example,</p>
  <pre><code>listnames = [&quot;Orpah Gail Winfrey&quot;, &quot;Montero Lamar Hill&quot;, &quot;Pablo Diego José Francisco de Paula Juan Nepomuceno María de los Remedios Cipriano de la Santísima Trinidad Ruiz y Picasso&quot;]
  
  print(clearmidname(listnames))
  </code></pre>
  <p>would give me</p>
  <pre><code>[&quot;Orpah Winfrey&quot;, &quot;Montero Hill&quot;, &quot;Pablo Picasso&quot;]
  </code></pre>