title: How to loop over a text file using while loop?
body: <p>if I have a text file like:</p>
  
  <pre><code>     StudentA:
        10
        20
        30
        40
  
        StudentB:
        60
        70 
        80
        90
  </code></pre>
  
  <p>I want to make a function :</p>
  
  <pre><code>    def read_file(file,student):
          file=file.open('file.txt','r')
  </code></pre>
  
  <p>when I call it,</p>
  
  <pre><code>     read_file(file,StudentA)
  </code></pre>
  
  <p>it will show the list like:</p>
  
  <pre><code>    [10,20,30,40]
  </code></pre>
  
  <p>How can I do it with a while loop?</p>