a for loop that won't pass beyond the first item in python
<p>I have this simple average function and when its run with a test data, will show the length of the data, but when calculating the actual average just won't go beyond the first item in the sequence.   I need help in finding what I am doing wrong here. Thanks in advance  for taking the time to answer if you do.</p>

<pre><code>def avg(seq):
    total = 0
    for i in seq:

        total+=i

        average = total/len(seq)
        return (float(average))

test_data = (12,89,90)
print(len(test_data))
print(avg(test_data))
</code></pre>
