return out of function : <p>Hi im working on a code but it is not working because i get the error: 'return' out of function</p>

<p>here is my code</p>

<pre><code>def get_information():
    names_list=[]
    coursework_marks_list=[]
    prelim_marks_list=[]

    file=open("details.txt","r")
for line in file:
    item=line.split()
    if len(item)&gt;1:
        names_list.append(item[0])
        coursework_marks_list.append(item[1])
        prelim_marks_list.append(item[2])

    return names_list,coursework_marks_list,prelim_marks_list
</code></pre>
