title: entry and loop in python
body: <p>I want to write a program that accept input from users multiple times. Calculate and print the average age as well as the number of males and females. Every time I run the script I get <em>ZeroDivisionError: integer division or modulo by zero</em> Also when I use the sum(ages) it returns 0. I need help please</p>
  <pre><code>print('Enter the required lines of text.')
  print('Enter an empty line to quit.')
  print('For sex enter M for male and F for female.')
  print ('_____________________________________________________________')
  
  # Start with a list containing several names.
  names = list()
  genders = list()
  ages = list()
  total = sum(ages)
  average = total / len(ages)
  # variables to append
  new_name = raw_input('Enter Name: ')
  new_sex = raw_input('Enter Sex: ')
  new_age = raw_input('Enter Age: ')
  
  # while NOT the termination condition
  while new_name != '':           
    names.append(new_name)
    genders.append(new_sex)
    ages.append(new_age)
    new_name = raw_input('Enter Name: ')
    new_sex = raw_input('Enter Sex: ')
    new_age = raw_input('Enter Age: ')  # !! reset value at end of loop!
  
  print('The sum of age is:', total)
  for new_name in names:
    for new_age in ages:
      for new_sex in genders:
        print(names)
        print(genders)
        print(ages)
        print(average)
  
  </code></pre>