title: Getting the average on random grades
body: <p>Does anyone know how to get the average of the random grades? She wants to generate just random grades and get the average but I had also done one where you input the grades on your end but I don't think that's what she was looking for.</p>
  <pre><code>import random
  
  grade = random.randint(50,100)
  grade2 = random.randint(50,100)
  grade3 = random.randint(50,100)
  grade4 = random.randint(50,100)
  grade5 = random.randint(50,100)
  
  if int(grade) &gt;= 90 and int(grade) &lt;= 100:
    print (&quot;Grade 1:&quot;, grade, &quot;A&quot;)
  elif int(grade) &gt;= 80 and int(grade) &lt;=90:
    print(&quot;Grade 1:&quot;, grade, &quot;B&quot;)
  elif int(grade) &gt;= 70 and int(grade) &lt;= 80:
    print(&quot;Grade 1:&quot;, grade, &quot;C&quot;)
  elif int(grade) &gt; 60 and int(grade) &lt;=70:
    print(&quot;Grade 1:&quot;, grade,&quot;D&quot;)
  elif int(grade) &lt;= 60:
    print(&quot;Grade 1:&quot;, grade, &quot;F&quot;)
  if int(grade2) &gt;= 90 and int(grade2) &lt;= 100:
    print (&quot;Grade 2:&quot;, grade2, &quot;A&quot;)
  elif int(grade2) &gt;= 80 and int(grade2) &lt;=90:
    print(&quot;Grade 2:&quot;, grade2, &quot;B&quot;)
  elif int(grade2) &gt;= 70 and int(grade2) &lt;= 80:
    print(&quot;Grade 2:&quot;, grade2, &quot;C&quot;)
  elif int(grade2) &gt; 60 and int(grade2) &lt;=70:
    print(&quot;Grade 2:&quot;, grade2,&quot;D&quot;)
  elif int(grade2) &lt;= 60:
    print(&quot;Grade 2:&quot;, grade2, &quot;F&quot;)
  if int(grade3) &gt;= 90 and int(grade3) &lt;= 100:
    print (&quot;Grade 3:&quot;, grade3, &quot;A&quot;)
  elif int(grade3) &gt;= 80 and int(grade3) &lt;=90:
    print(&quot;Grade 3:&quot;, grade3, &quot;B&quot;)
  elif int(grade3) &gt;= 70 and int(grade3) &lt;= 80:
    print(&quot;Grade 3:&quot;, grade3, &quot;C&quot;)
  elif int(grade3) &gt; 60 and int(grade3) &lt;=70:
    print(&quot;Grade 3:&quot;, grade3,&quot;D&quot;)
  elif int(grade3) &lt;= 60:
    print(&quot;Grade 3:&quot;, grade3, &quot;F&quot;)
  if int(grade4) &gt;= 90 and int(grade4) &lt;= 100:
    print (&quot;Grade 4:&quot;, grade4, &quot;A&quot;)
  elif int(grade4) &gt;= 80 and int(grade4) &lt;=90:
    print(&quot;Grade 4:&quot;, grade4, &quot;B&quot;)
  elif int(grade4) &gt;= 70 and int(grade4) &lt;= 80:
    print(&quot;Grade 4:&quot;, grade, &quot;C&quot;)
  elif int(grade4) &gt; 60 and int(grade4) &lt;=70:
    print(&quot;Grade 4:&quot;, grade4,&quot;D&quot;)
  elif int(grade4) &lt;= 60:
    print(&quot;Grade 4:&quot;, grade4, &quot;F&quot;)
  if int(grade5) &gt;= 90 and int(grade5) &lt;= 100:
    print (&quot;Grade 5:&quot;, grade5, &quot;A&quot;)
  elif int(grade5) &gt;= 80 and int(grade5) &lt;=90:
    print(&quot;Grade 5:&quot;, grade5, &quot;B&quot;)
  elif int(grade5) &gt;= 70 and int(grade5) &lt;= 80:
    print(&quot;Grade 5:&quot;, grade5, &quot;C&quot;)
  elif int(grade5) &gt; 60 and int(grade5) &lt;=70:
    print(&quot;Grade 5:&quot;, grade5,&quot;D&quot;)
  elif int(grade5) &lt;= 60:
    print(&quot;Grade 5:&quot;, grade5, &quot;F&quot;)
  </code></pre>