2009 109
Revision as of 12:52, 9 December 2008 by Michael Murtaugh (talk | contribs)
In-class, doing Exercise
def histogram(s):
d = dict()
for c in s:
if c not in d:
d[c] = 1
else:
d[c] += 1
return d
In-class, doing Exercise
def histogram(s):
d = dict()
for c in s:
if c not in d:
d[c] = 1
else:
d[c] += 1
return d