-Copyright ⓒ 2014 Benjamin Mako Hill (http://mako.cc/)
+Copyright ⓒ 2014-2015 Benjamin Mako Hill (http://mako.cc/)
-Released as free software under the GNU General Public License v2 or any
-later version.
+Released as free software under the GNU General Public License v3 or any later
+version.
These are example programs for use in the Community Data Science
Workshops. More details are available here:
-https://openhatch.org/wiki/Community_Data_Science_Workshops
+http://wiki.communitydata.cc/Community_Data_Science_Workshops
Data for this project (the txt files) are downloaded from the US Social
Security administration and are public domain:
for name in ssadata.boys.keys():
if name == "mako":
- print "There were " + str(ssadata.boys[name]) + " boys named " + name
+ print("There were " + str(ssadata.boys[name]) + " boys named " + name)
for name in ssadata.boys.keys():
if name in ssadata.girls.keys():
- print name
+ print(name)
for name in ssadata.boys.keys():
if 'king' in name:
- print name + " " + str(ssadata.boys[name])
+ print(name + " " + str(ssadata.boys[name]))
for name in ssadata.girls.keys():
if 'queen' in name:
- print name + " " + str(ssadata.girls[name])
+ print(name + " " + str(ssadata.girls[name]))
boys = {}
girls = {}
-for line in file(NAMES_LIST, 'r').readlines():
+for line in open(NAMES_LIST, 'r').readlines():
name, gender, count = line.strip().split(",")
count = int(count)