title: How to load data from a .csv file without importing the .csv module/library
body: <pre><code>def loadfunc(filestr):
  listoftuples = []
  listofnumbers = []
  tupleinlist = []
  with open(filestr, 'r') as file:
      for line in file:
          for item in line:
              if item.isdigit():
                  listofnumbers.append(float(item))
              else:
                  word = item
  tupleinlist.append(word)
  tupleinlist.append(listofnumbers)
  listoftuples.append(tuple(tupleinlist))
  return listoftuples
  print(listoftuples)
  </code></pre>
  
  <p>Above is my code. So the requirement is to load data from a .csv file and into a list of tuples. The data in the file is something like:</p>
  
  <pre><code> - apple    23.2    24.3    25.6
   - banana   22.1    20.0    19.9
  </code></pre>
  
  <p>Withing each tuple in the list it has to be <code>(word, listoffloats)</code> so the list would look like: </p>
  
  <pre><code>[(apple, [23.2, 24.3, 25.6]), (banana, [22.1, 20.0, 219.9])]
  </code></pre>
  
  <p>But with my code it screws this up and doesn't return it because when it iterates over "item" in each "line", it iterates over each character (like <code>.</code>, <code>a</code>, <code>p</code>, <code>p</code>, <code>l</code>, <code>e</code>) rather than item being things like <code>apple</code>, <code>23.2</code>, etc.</p>
  
  <p>Help please I don't know how to fix this and no it is not allowed to use csv libraries/modules for this tutorial.</p>