title: How do I print the amount of marks above the grade boundary and marks below the next?
body: <p>I have to code pretty much correct with printing the correct grade, it just prints grade: U and then the correct grade as well and i don't know why this is.</p>
  <pre><code>grades = [&quot;A*&quot;, &quot;A&quot;, &quot;B&quot;, &quot;C&quot;, &quot;D&quot;, &quot;E&quot;, &quot;U&quot;]
  
  mark1 = int(input(&quot;Computer systems score /140: &quot;))
  mark2 = int(input(&quot;Algorithms and programming score /140: &quot;))
  mark3 = int(input(&quot;Programming project score /70: &quot;))
  totalScore = mark1 + mark2 + mark3
  print(&quot;Total:&quot;, totalScore, &quot;/350&quot;)
  
  gradeScore = {284 &lt;= totalScore &lt;= 350:grades[0],
      246 &lt;= totalScore &lt; 284:grades[1],
      208 &lt;= totalScore &lt; 246:grades[2],
      171 &lt;= totalScore  &lt; 208:grades[3],
      134 &lt;= totalScore &lt; 171:grades[4],
      97 &lt;= totalScore &lt; 134:grades[5],
      0 &lt;= totalScore &lt; 97:grades[6]}
  
  for i in gradeScore:
      print(&quot;Grade: &quot;, gradeScore[i])
  </code></pre>
  <p>And then when i input the scores it adds it up correctly but prints:</p>
  <pre><code>Computer systems score /140: 57
  Algorithms and programming score /140: 68
  Programming project score /70: 35
  Total: 160 /350
  Grade:  U
  Grade:  D
  </code></pre>
  <p>I also need to print the amount of marks above the grade boundary you're at and the amount of marks below the next grade, how would i do this without a long if statement?</p>