Permalink
Browse files

Sorting issue

  • Loading branch information...
1 parent becd6ba commit 37cc59f176f82a1c95575cc0fdf4cec0e2fd473e @ynadji committed Apr 5, 2011
Showing with 5 additions and 1 deletion.
  1. +5 −1 wulib.py
View
@@ -118,4 +118,8 @@ def frequency(iterable):
for item in iterable:
d[item] += 1
- return (d.keys(), d.values())
+ keys = sorted(d.keys())
+ values = []
+ for key in keys:
+ values.append(d[key])
+ return (keys, values)

0 comments on commit 37cc59f

Please sign in to comment.