Advertisement
Guest User

Untitled

a guest
Aug 23rd, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.19 KB | None | 0 0
  1. import pprint
  2. message = 'This is a sentence from which we will count the characters'
  3. count = {}
  4.  
  5. for char in message.upper():
  6. count.setdefault(char, 0)
  7. count[char] += 1
  8. pprint.pprint(count)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement