summaryrefslogtreecommitdiff
path: root/day1/exercise
diff options
context:
space:
mode:
authorSantosh G. Vattam2009-10-09 16:59:30 +0530
committerSantosh G. Vattam2009-10-09 16:59:30 +0530
commit2aa27f55cc5ee298c557fb0d00597aaef9eb3281 (patch)
tree619e748f7c5fd1b2d6b50c20f7219275f093f224 /day1/exercise
parent260bbb26aa0beb9b65606dda32efa12e0c3a68e8 (diff)
parentcfde727f0f29e83c6aea85231057e679281f6ac3 (diff)
downloadworkshops-2aa27f55cc5ee298c557fb0d00597aaef9eb3281.tar.gz
workshops-2aa27f55cc5ee298c557fb0d00597aaef9eb3281.tar.bz2
workshops-2aa27f55cc5ee298c557fb0d00597aaef9eb3281.zip
Merged branches.
Diffstat (limited to 'day1/exercise')
-rw-r--r--day1/exercise/kwfreq.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/day1/exercise/kwfreq.py b/day1/exercise/kwfreq.py
index 32a8765..0da7ff3 100644
--- a/day1/exercise/kwfreq.py
+++ b/day1/exercise/kwfreq.py
@@ -1,5 +1,5 @@
import keyword
-f = open('/home/madhu/pyprogs/pytriads.py')
+f = open('/path/to/file')
freq = {}
for line in f:
@@ -7,7 +7,7 @@ for line in f:
for word in words:
key = word.strip(',.!;?()[]: ')
if keyword.iskeyword(key):
- value = freq.get(key, 1)
+ value = freq[key]
freq[key] = value + 1
print freq