Advertisement
Guest User

Untitled

a guest
Dec 5th, 2016
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.36 KB | None | 0 0
  1. #-*- coding: utf-8 -*-
  2. from string import ascii_lowercase
  3. from collections import Counter
  4. import string
  5. chars = []
  6. allowed = string.ascii_letters +"æ" "ø" "å"
  7.  
  8. d = {}
  9. #Initialize d
  10. for letter in allowed:
  11.     d[letter] = 0
  12.  
  13. with open('/Users/Thomas/Dropbox/Boag-3R.R/SRP/tællemaskine/tekst.txt') as f:
  14.     for c in f.read():
  15.         d[c.lower()] += 1
  16.  
  17. print d
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement