Python - can't get the list inside the function
<p>I wrote this code:</p>

<pre><code>answer=[]
def find_all(collection, item):
    import UserString
    collection = UserString.MutableString(collection)   # Turn the string to mutable
    if len(collection)==0:
            return answer
    if collection[len(collection)-1]==item:
            answer.insert(0, len(collection)-1)
    del collection[len(collection)-1]
    return find_all(collection,item)
</code></pre>

<p>It should give me an output list of location in the string/number depend on the number('item'). 
I tried many versions of it but still cant the <code>list('answer=[]')</code> inside the def.
Whats the way to do it?</p>

<p>Edit: I forgot to mention, I should make this code work in recursion to practice recursion on python.
Jon thank you! but this is why I didn't use loops.</p>

<p>Thank you</p>
