title: Python Find the mean school assignment - What is a loop?
body: <p>I have been working on this assignment for about 2 weeks and have nothing done. I am a starter at coding and my teacher is really not helping me with it. She redirects me to her videos that I have to learn from every time and will not directly tell or help me on how I can do it. Here are the instructions to the assignment (said in a video, but made it into text.</p>
  <p><em>Find the mean
  Create a program that finds the mean of a list of numbers.
  Iterate through it, and instead of printing each item, you want to add them together.
  Create a new variable inside of that, that takes the grand total when you add things together,
  And then you have to divide it by the length of your array, for python/java script you’ll need to use the method that lets you know the length of your list.
  Bonus point for kids who can find the median, to do that you need to sort your list and then you need to remove items from the right and the left until you only have one left
  All you’re doing is you need to create a variable that is your list
  Create another variable that is a empty one at the moment and be a number
  Iterate through your list and add each of the numbers to the variable you created
  Then divide the number by the number of items that you had in the list.</em></p>
  <p>Here's what I've done so far.</p>
  <pre><code>num = [1, 2, 3, 4, 5, 6];
  total = 0;
  
  total = (num[0] + total)
  total = (num[1] + total)
  total = (num[2] + total)
  total = (num[3] + total)
  total = (num[4] + total)
  total = (num[5] + total)
  
  print(total)
  </code></pre>
  <p>However, she tells me I need to shorten down the <code>total = (num[_] + total)</code> parts into a loop. Here is how she is telling me to do a loop in one of her videos.</p>
  <p><code>for x in ____: print(x)</code>
  or
  <code>for x in range(len(___)): print (x+1, ____[x])</code></p>
  <p>there is also</p>
  <pre><code>while i &lt; len(___):
  print(___[i])
  i = i + 1
  </code></pre>
  <p>I really don't understand how to do this so explain it like I'm a total noob.</p>