title: TypeError: 'function' object is unsubscriptable in Python?
body: <p>I have an array of string objects, with color codes for plotting graphs, which looks like this: <code>colors = ["ob-", "or-", "oy-", "og-", "om-", "op-"]</code></p>
  
  <p>When i try to access it with a for loop (where its index is less than the array length) i get the following error message: TypeError: 'function' object is unsubscriptable</p>
  
  <p>The accessing code looks like this: </p>
  
  <pre><code>for i in range(len(files)):
      l = plt.plot(data[0], data[i+1], colors[i], label='Iteration-' + str(i))
  </code></pre>
  
  <p>I printed the color before and everything seems fine, I tried to check this on previous posts there were many, but i couldnt find quite the right solution.</p>
  
  <p>So what could it be the problem or solution to this? </p>
  
  <p>Many thanks in advance.</p>