title: I am trying to write a Python code that reads each item in a list and add and find the average of that list with certain conditions
body: <p>So I'm trying to add all the numbers of a list and divide that sum by how many numbers in that list are not equal to 0. The code does not include the part where I summed all the numbers together. What I did in this part of my code is that I tried to check each individual item in a list one at a time. Eventually, it would tell me how many numbers were not equal to zero with the variable sum_div.</p>
  <pre><code>b=4
  c=0
  d=6
  e=0
  
  I_list = [ b, c, d, e]
  
  sum_div = 0
  
  ip = I_list[0]
  
  for i in range(0, len(I_list), 1) :
      while ip != 0:
          sum_div += 1
      elif ip == 0:
          sum_div += 0
      
  print(sum_div)
  </code></pre>
  <p>sum_div was supposed to equal 2 in this case.</p>