title: Read line of numbers into lists in Python
body: <p>I am trying to read two lines from a file into two lists such that each line is in one list.</p>
  
  <p><strong>data.txt</strong>:</p>
  
  <blockquote>
    <p>1,5,7,18,9,8,12<br>
    2,41,12,11,1,10</p>
  </blockquote>
  
  <p><strong>The code I've tried:</strong></p>
  
  <pre><code>list1 = []
  list2 = []
  infile = open("data.txt","r")
  line = infile.readline()
  for line in infile:
      line = line.split(',')
      list1.append(float(line))
      line = infile.readline()
      list2.append(float(line))
      print(list1)
      print(list2)
  print()
  </code></pre>
  
  <p><strong>What I want to have:</strong></p>
  
  <pre><code>list1 = [1, 5, 7, 18, 9, 8, 12]
  list2 = [2, 41, 12, 11, 1, 10]
  </code></pre>
  
  <p>How can I fix my code?</p>