Skip to content

Update count #74

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Oct 29, 2016
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Another way to code CountMillionCharacter.py in a single line
  • Loading branch information
qhuang872 committed Sep 8, 2016
commit fa8e73499164caaab5389361ee8245fe05c99a1c
3 changes: 1 addition & 2 deletions CountMillionCharacter.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,7 @@
Exeunt'''
count = { }
for character in info.upper():
count.setdefault(character, 0)
count[character] = count[character]+1
count[character] = count.get(character,0)+1

value = pprint.pformat(count)
print(value)