'int' object is not callable when using groupby
<p>I am trying to find the longest sequence of numbers in a list using the following code</p>

<pre><code>from itertools import groupby
ggg = groupby([1,2,3,3,3,5,88,9,9,9,9,9,9,9,1,1,1,2,2,3,3,3,3,3])
max(ggg, key=lambda k: len(list(k[1])))
</code></pre>

<p>However, I get the error 'int' object is not callable.  Additionally, I am using python 3. </p>

<p>Your code works for me in Python 3.  My best guess is that your problem is coming from assigning <code>len</code>, <code>list</code>, or <code>max</code> to be an <code>int</code>.  For example:</p>

<pre><code>&gt;&gt;&gt; list_a = [1, 2]
&gt;&gt;&gt; len(list_a)
2
&gt;&gt;&gt; len = 4
&gt;&gt;&gt; len(list_a)
Traceback (most recent call last):
  File "&lt;pyshell#3&gt;", line 1, in &lt;module&gt;
    len(list_a)
TypeError: 'int' object is not callable
</code></pre>

python