title: How to convert a string into a float when reading from a text file
body: <p>Hey guys so I have a text file that I am trying to read from and receive every number string
  and convert it into a float. But every time I try it, it says "cannont convert string to float". Why is this happening? Thanks!</p>
  
  <pre><code>try:
      input_file = open("Dic9812.TFITF.encoded.txt","r")
      output_fileDec = open("Dic9812.TFITF.decoded.txt","w")
      output_fileLog = open("Dic9812.TFITF.log.txt","w")
  except IOError:
      print("File not found!")
  
  coefficientInt = input("Enter a coefficient: ")
  coefficientFl = float(coefficientInt)
  constInt = input("Enter a constant: ")
  constFl = float(constInt)
  
  try:
      for line in input_file:
          for numstr in line.split(","):
              numFl = float(numstr)
              print(numFl)
  except Exception as e:
      print(e)
  </code></pre>
  
  <p>The file looks like this:</p>
  
  <pre><code>135.0,201.0,301.0
  152.0,253.0,36.0,52.0
  53.0,25.0,369.0,25.0
  </code></pre>
  
  <p>It ends up printing the numbers but at the end it says:
  cannot convert string to float:</p>