title: How to calculate total students passed and failed the test
body: <p>I'm doing this exercise:</p>
  <blockquote>
  <p>Write a program that will ask the user to key in N, that is the size
  of a class.  Given that the passing mark for a subject test is 50,
  count how many of the students passed and failed the test.  Calculate
  the average mark obtained by the students.  Make sure all marks
  entered are valid (between 0 and 100). If user enters an invalid mark,
  prompt a message “Invalid Marks !!!” and the program continue outside
  the loop.</p>
  </blockquote>
  <p>This is my solution:</p>
  <pre><code>n = int(input('Enter Any Size of Class You Want: ')) 
  
  intList = []
  for i in range(1, n + 1):
      value = int(input(&quot;Enter Marks (0 - 100): &quot;))
      intList.append(value)
      i = value
      pass_student = 0
      invalid = 0
      fail_student = 0
      if i &gt;= 50:
          pass_student = pass_student + 1
      
      elif i &gt;= 100:
          invalid = invalid + 1
      
      elif i &lt; 50:
          fail_student = fail_student + 1
      
    
  print('The Total Passed Student: ', pass_student)
  print('Invalid Marks!!!')
  print('The Total Failed Student: ', fail_student)
  
  
  #Average
  
  average = value / n
  print('The Average is: ', average)
  </code></pre>
  <p>The output that I got:</p>
  <pre class="lang-none prettyprint-override"><code>Enter Any Size of Class You Want: 2
  Enter Marks (0 - 100): 45
  Enter Marks (0 - 100): 64
  The Total Passed Student:  1
  Invalid Marks!!!
  The Total Failed Student:  0
  The Average is:  32.0
  </code></pre>
  <p>The sample output:</p>
  <pre class="lang-none prettyprint-override"><code>Enter Any Size of Class You Want:  4
  Enter Marks (0 – 100) : 40
  Enter Marks (0 – 100) : 60
  Enter Marks (0 - 100) : 30
  Enter Marks (0 – 100) : 200
  Invalid Marks !!!
  The Total Passed Student   : 1
  The Total Failed Student     : 2
  The Average is:  43
  </code></pre>