title: "Int object has no attribute" error when calling list object from list obtained by append in custom module
body: <p>I have to make a counter for the number of times an element occurs in a list using really basic loops with a limited number of operations.
  When the I don't use the module and integrate it into the code directly the error disappear.</p>
  
  <pre><code>def norepeat(a):
  R=[]
  i=0
  while i&lt;len(a):
      if a[i] in R:
          i=i+1
      else:
          R.append(a[i])
          i=i+1
  return R
  
  a=list(input("enter list(elements seperated by commas):"))
  L=len(a)
  R=norepeat(a)
  print R
  print R[1]
  l=(len(R))
  print l
  i=0
  while i&lt;l:
      j=0
      count=0
      while j&lt;L:
          if R[i]==L[j]:#error:'int' object has no attribute '__getitem__'
              count+=1
          if j==l-1:
              print R[i],"occurs",count,"times"
      j=j+1
  i=i+1
  
  ---------------------------------------------------------------------------
  TypeError                                 Traceback (most recent call last)
  &lt;ipython-input-13-73b7f443c37e&gt; in &lt;module&gt;()
   23     count=0
   24     while j&lt;L:
   ---&gt; 25         if R[i]==L[j]:
   26             count+=1
   27         if j==l-1:
  
   TypeError: 'int' object has no attribute '__getitem__'
  </code></pre>