Created
August 27, 2012 10:36
-
-
Save peterarnott/3487325 to your computer and use it in GitHub Desktop.
My solution to the week5 challenge
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#peterarenot | |
import requests; i = open("input.txt"); o = open("output.txt", 'w'); d = {} | |
for l in i.readlines(): d[l] = float(requests.get("http://finance.yahoo.com/d/quotes.csv", params={'s': l, 'f': 'j1'}).text[:-3]) | |
for k in sorted(d, key=d.get, reverse=True): o.write("%s - %sB\n" % (k.strip(), d[k])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment