title: How to parse csv file and compute stats based on that data
body: <p>I have a task which requires me to make a program in python that reads a text file which has information about people (name, weight and height). </p>
  
  <p>Then I need the program to ask for the user to enter a name then look for that name in the text file and print out the line which includes that name and the person's height and weight.</p>
  
  <p>Then the program has to work out the average weight of the people and average height. </p>
  
  <p>The text file is:</p>
  
  <pre class="lang-none prettyprint-override"><code>James,73,1.82,M
  Peter,78,1.80,M
  Jay,90,1.90,M
  Beth,65,1.53.F
  Mags,66,1.50,F
  Joy,62,1.34,F
  </code></pre>
  
  <p>So far I have this code which prints out the line using the name that has been typed by the user but I don't know to assign the heights and the weights:</p>
  
  <pre><code>search = input("Who's information would you like to find?")
  with open("HeightAndWeight.txt", "r") as f:
      for line in f:
          if search in line:
              print(line)
  </code></pre>