This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Nov 26th, 2011  |  syntax: None  |  size: 0.61 KB  |  views: 29  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. 2. Python’s set objects have a method called pop that removes and
  2. returns an arbitrary element from the set. If a set gerbils contains
  3. five cuddly little animals, for example, calling gerbils.pop()
  4. five times will return those animals one by one, leaving the set
  5. empty at the end. Use this to write a function called mating_pairs
  6. that takes two equal-sized sets called males and females as input
  7. and returns a set of pairs; each pair must be a tuple containing
  8. one male and one female. (The elements of males and females may
  9. be strings containing gerbil names or gerbil ID numbers—your
  10. function must work with both.)
  11.  
clone this paste RAW Paste Data