Skip to content

Commit f4ab763

Browse files
Merge pull request geekcomputers#74 from qhuang872/update-Count
Update count
2 parents ca8e141 + a41d85f commit f4ab763

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

CountMillionCharacter.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,8 +289,7 @@
289289
Exeunt'''
290290
count = { }
291291
for character in info.upper():
292-
count.setdefault(character, 0)
293-
count[character] = count[character]+1
292+
count[character]=count.get(character,0)+1
294293

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

0 commit comments

Comments
 (0)