Skip to content

Instantly share code, notes, and snippets.

@salayhin
Created November 5, 2015 10:22
Show Gist options
  • Save salayhin/7966fd26be7ac3e29d10 to your computer and use it in GitHub Desktop.
Save salayhin/7966fd26be7ac3e29d10 to your computer and use it in GitHub Desktop.
import json
import urllib
url = 'http://pr4e.dr-chuck.com/tsugi/mod/python-data/data/comments_168215.json'
input = urllib.urlopen(url).read()
info = json.loads(input)
#print info
sum = 0
for item in info['comments']:
sum = sum + int(item['count'])
print sum
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment