title: Regarding Index out of range error
body: <pre><code>def sum_squares(n):
      sum=0
  
      for i in range(1,len(n)+1):
          sum=0
  
          for j in range(1,n[i]):
              sum+=j**2
  
          print('The sum:',sum)
  n=[2]
  sum_squares(n)
  </code></pre>
  
  <p>Here, I am getting an error in the line <code>for j in range(1,n[i]):</code>
  When it is <code>i-1</code> it works, but what is needed is <code>i</code>.</p>