converting a '[1,2,3,4]' to a float or int in python
<p>Hi so I am trying to find the avg of a list
We have to make a function so I have</p>

<pre><code>def avgLst():
    'str==&gt;avg of numbers in str'
    x=input('Please enter a List: ')

    if len(x)==0:
        return([])
</code></pre>

<p>It is from this point I am having trouble.
I am trying to find to avg of the input we put into the problem.
something like[1,2,3,4] problem is this list is a string because of the input. How do I get the list to be a list of integers or floats to then find the avg of the list?
Thanks,</p>
