can someone explain the code
<p>can someone explain the code How it works:
I am not familiar with while loop</p>

<pre><code> line = file.readline()
 L1=[]
 while line != '' and line != '\n':
    line = line[:-1].split()
    L1.append(line)
    line = file.readline()

 return L1
</code></pre>

<p>and  can I do it with a for loop?
Is it:</p>

<pre><code>     for line in file.readline():
          if line !='' and line !='\n':
             line = line[:-1].split()
             L1.append(line)

     return L1
</code></pre>
