Alternative to list.count( ) in python
<p>I am looking to be able to write an alternative code to the built in count in python:
This code works</p>

<pre><code>def count(element,seq):
    """Counts how often an element occurs
    ...in a sequence"""
    mycount = seq.count(element)
    return mycount
</code></pre>

<p>but I would like to write it in a for loop (or  another way?), I've got this far:</p>

<pre><code>def count(element,seq):
    """Counts how often an element occurs
    ...in a sequence"""
    for i in seq:
        if  element == seq:
            print i
</code></pre>

<p>I'm not sure how to return the re-occuring elements as an integer. Any help appreciated!!</p>
