title: Why I put a for loop inside a function cannot work?
body: <p>here is my code
  I am wondering why i cannot put a 'for loop' into a function</p>
  
  <pre><code>&gt;&gt;&gt; a=[5,3,5,6,8,9,0,1,3]
  &gt;&gt;&gt; def classification(input):
          scoreget=0
          for i in range(0,8):
              if input[i]&gt;2:
                   scoreget+=1
              else:
                   scoreget+=0
              return scoreget
  &gt;&gt;&gt; result=classification(a)
  &gt;&gt;&gt; print result
  </code></pre>
  
  <p>The result should be [1,1,1,1,1,1,0,0,1], but it showed only one value '1',not a set. </p>