title: TypeError: 'int' object is not iterable?
body: <p>I was implementing the dynamic programming algorithm and I got this error. This is my code:</p>
  
  <pre><code>def shoot(aliens):
      s=[0]*10
      s[0]=0
      s[1]=0
      for j in xrange(2,len(aliens)):
          for i in xrange(0,j):
             s[j]=max(s[i] + min(aliens[j],fib(j-i))) &lt;---Error here
      print s[len(aliens)-1]
      return s[len(aliens)-1]
  
  def fib(n):
      if n == 0:
          return 0
      if n == 1:
          return 1
      return fib(n-1) + fib(n-2)
  
  aliens=[1,10,10,1]
  print shoot(aliens)
  </code></pre>
  
  <p>it says that:</p>
  
  <pre><code>Traceback (most recent call last):
  File "module1.py", line 30, in &lt;module&gt;
  print shoot(aliens)
  File "module1.py", line 19, in shoot
  s[j]=max(s[i] + min(aliens[j],fib(j-i)))
  TypeError: 'int' object is not iterable
  </code></pre>
  
  <p>Please help me</p>
  
  <p>UPDATE:
  oh, I get it.
  I mean</p>
  
  <pre><code>s[j]=max(s[i] + min(aliens[j],fib(j-i)))
  </code></pre>
  
  <p>But im wrong.
  so, I edited it like that, but I do not know how to use max() to take out the largest in an array.</p>
  
  <pre><code>    b=0
      for j in xrange(2,len(aliens)):
          for i in xrange(0,j):
             a[b]=(s[i] + min(aliens[j],fib(j-i)))
             b+=1
          s[j]=Largest(a[b]);   &lt;--How can I do that with Max() function
  </code></pre>