Using a list in a function python : <pre><code>file = open('Info.txt', 'r')
x = str(file.read())
file.close()
info = re.findall(r'\w+', x)
j = len(info)
Fname = [0] * j

def FirstName(info, j, FName):
    i = 0

    n = 0
    while i&lt;j:
        name = info[i]
        name = name.upper()
        name = list(name)
        Fname[n] = name[0]
        i = i + 3
        n = n + 1
</code></pre>

<p>I am trying to use the list "FName" in the function I defined as "Firstname". But when i run the program, I get an error stating that "Fname is not defined".</p>

<p>The solution is probably very simple but I am new to python.</p>

<p>Thanks</p>
