title: Python: Finding Longest/Shortest Words In a List and Calling Them in a Function
body: <p>I have a list of words:
          words=["alpha","omega","up","down","over","under","purple","red","blue","green"]
  I have two functions that are supposed to find the shortest and longest words in this list:</p>
  
  <pre><code>def bigWords(list=[], *args):
      largestWord=""
      largestLen=0
      for word in list:
          if largestWord&lt;len(word):
              largestWord=len(word)
              largestWord=word
      print "The longest word(s) in the list is %s." % largestWord
  
  def smallWords(list=[], *args):
      smallestWord=""
      smallestLen=0
      for word in list:
          if smallestLen&gt;len(word):
              smallestLen&gt;len(word)
              smallestWord=word
      print "The shortest word(s) in the list is: %s." % (smallestWord)
  </code></pre>
  
  <p>I have these functions nested so I can call them all at once:</p>
  
  <pre><code>def callFunctions():
  ###Words###
      words=["alpha","omega","up","down","over","under","purple","red","blue","green"]
  
      wordLength=lenList(words)
      print "The amount of words[] is %d" % wordLength
      func_list2 = [bigWords, smallWords]
      for f in func_list2:
          map(f, words)
  
  callFunctions()
  </code></pre>
  
  <p>This is just returning this without inputing the words in the list:</p>
  
  <pre><code>The longest word(s) in the list is .
  The longest word(s) in the list is .
  The longest word(s) in the list is .
  The longest word(s) in the list is .
  The longest word(s) in the list is .
  The longest word(s) in the list is .
  The longest word(s) in the list is .
  The longest word(s) in the list is .
  The longest word(s) in the list is .
  The longest word(s) in the list is .
  The shortest word(s) in the list is: .
  The shortest word(s) in the list is: .
  The shortest word(s) in the list is: .
  The shortest word(s) in the list is: .
  The shortest word(s) in the list is: .
  The shortest word(s) in the list is: .
  The shortest word(s) in the list is: .
  The shortest word(s) in the list is: .
  The shortest word(s) in the list is: .
  The shortest word(s) in the list is: .
  </code></pre>
  
  <p>Not sure why, any help is appreciated.</p>