Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pprint
- message = 'This is a sentence from which we will count the characters'
- count = {}
- for char in message.upper():
- count.setdefault(char, 0)
- count[char] += 1
- pprint.pprint(count)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement