title: Python item sort
body: <pre><code>my_list=raw_input('Please enter a list of items (seperated by comma): ')
  my_list=my_list.split()
  my_list.sort()
  
  print "List statistics: "
  print ""
  
  for x in set(my_list):
      z=my_list.count(x)
  
  if z&gt;1:
      print x, "is repeated", z, "times."
  else:
      print x, "is repeated", z, "time."
  </code></pre>
  
  <p>The output only prints one of the items in the list.  I need to sort the list (dog, cat, bird, dog, dog) to count how many items are in the list, such as:</p>
  
  <p>bird is repeated 1 time.
  cat is repeated 1 time.
  dog is repeated 3 times.</p>
  
  <p>The problem is that it only outputs 1 item:</p>
  
  <p>bird is repeated 1 time.</p>