Want more features on Pastebin? Sign Up, it's FREE!
Guest

JoeNotCharles

By: a guest on Jan 9th, 2011  |  syntax: Python  |  size: 0.31 KB  |  views: 156  |  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. #!/usr/bin/env python
  2.  
  3. import sys
  4. rankings = sys.stdin.readline().strip().split(" > ")
  5.  
  6. candidateNum = 0
  7. candidates = {}
  8. f = open("candidates.txt", "r")
  9. for line in f:
  10.     candidateNum += 1
  11.     candidates[candidateNum] = line.strip()
  12. f.close()
  13.  
  14. for candidate in rankings:
  15.     print candidates[int(candidate)]
clone this paste RAW Paste Data