title: How to sum number of Ints and Number of Floats within a List - Scala
body: <p>I need to calculate the number of integers and floats i have in a Map which is like <code>Map[String, List[(Int, String, Float)]]</code></p>
  
  <p>The data comes from reading a file - the data inside for example looks kinda like (however there is a few more Routes): </p>
  
  <pre><code>Cycle Route (City),1:City Centre :0.75f,2:Main Park :3.8f,3:Central Station:2.7f,4:Modern Art Museum,5:Garden Centre:2.4f,6:Music Centre:3.4f
  </code></pre>
  
  <p>The map is split so that the String is the name of the route and the List is the rest of the data. </p>
  
  <p>I want it to calculate the number of 'checkpoints' per route and total distance of each route (which is the float) then print out e.g. Oor Wullie Route has 6 checkpoints and total distance of 18.45km </p>
  
  <p>I am guessing I need to use a <code>foldLeft</code> however i am unsure how to do so? </p>
  
  <p>Example of a simple fold i have done before but not sure how to apply one to above scenario? </p>
  
  <pre><code>val list1 = List.range(1,20)
  
  def sum(ls:List[Int]):Int = {
    ls.foldLeft(0) { _ + _}
  }
  </code></pre>