title: Unsupported operand type(s) for +: 'float' and 'str' error
body: <p>I am trying to add the contents of the score file together and get an average but I can't seem to get it to work.</p>
  <p>My code:</p>
  <pre class="lang-py prettyprint-override"><code># open and read file student / score
  student_file = open(&quot;Student.txt&quot;, &quot;r&quot;)
  score_file = open(&quot;Score.txt&quot;, &quot;r&quot;)
  student = student_file.read().split(' ')
  score = score_file.read().split(' ')
  addedScore = 0.0
  average = 0.0
  
  for i in range(0,len(student)):
  
      print(&quot;Student: &quot;+student[i]+&quot; Final: &quot;+score[i])          
      addedScore = addedScore + score[i]
  
  average = addedScore / 2
  print(&quot;The class average is:&quot;, average)
  </code></pre>
  <p>The score file is full of float numbers:</p>
  <pre class="lang-none prettyprint-override"><code>90.0 94.0 74.4 63.2 79.4 87.6 67.7 78.1 95.8 82.1
  </code></pre>
  <p>The error message</p>
  <pre class="lang-none prettyprint-override"><code>line 12, in &lt;module&gt;
  addedScore = addedScore + score[i]
  TypeError: unsupported operand type(s) for +: 'float' and 'str'
  </code></pre>