import requests

r = requests.get("https://stepic.org/api/leaders")

print "Current leaders:\n"

for leader in r.json()["leaders"]:
    user = requests.get("https://stepic.org/api/users/" + str(leader["user"])).json()["users"][0]
    print leader["score"], '\t', user['first_name'], user['last_name']
@@ -8,16 +8,33 @@
 requests
+%0Aimport grequests
 %0A%0Ar = re
@@ -81,84 +81,277 @@
 rs%22)
-%0A%0Aprint %22Current leaders:%5Cn%22%0A%0Afor leader in r.json()%5B%22leaders%22%5D:%0A    user
+  # get the first page of leader list%0A%0Aleaders = %5B%22https://stepic.org/api/users/%22 + str(leader%5B%22user%22%5D)%0A           for leader in r.json()%5B%22leaders%22%5D%5D  # form urls for leaders%0A%0Ascores = %7Bl%5B%22user%22%5D: l%5B%22score%22%5D for l in r.json()%5B%22leaders%22%5D%7D  # remember all scores%0A%0Ars
  = 
+%5Bg
 requ
@@ -363,62 +363,172 @@
 get(
-%22https://stepic.org/api/users/%22 + str(leader%5B%22user%22%5D))
+l) for l in leaders%5D  # prepare all requests%0Aresult = grequests.map(rs)  # execute requests concurrently%0A%0Aprint(%22Current leaders:%5Cn%22)%0A%0Afor r in result:%0A    user = r
 .jso
@@ -556,24 +556,32 @@
 rint
- leader%5B%22scor
+(scores%5Buser%5B%22profil
 e%22%5D
+%5D
 , '%5C
@@ -613,16 +613,17 @@
 ser%5B'last_name'%5D
+)

Fix python3