title: How does the max() function work in Jython?
body: <p>I need this function to tell me the longest sequence of positive numbers in a list.</p>
  
  <pre><code>def longestSequencePos(nums):
      index = 0
      list = []
      integ = 0
  
      for obj in nums:
        if obj &gt; 0:
          index = index +1
        else: 
          list.append(index)
          index = 0
      return max(list)
  </code></pre>
  
  <p>list should contain all of the lengths of the sequences of positives, but the max function is not working. </p>