Created
November 15, 2020 06:33
-
-
Save lyo/a537a7a9115596730548d59bc3c5685c to your computer and use it in GitHub Desktop.
アルファベット出現頻度確認
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import collections, sys | |
from string import ascii_lowercase | |
def filecharcount(openfile): | |
return sorted(collections.Counter(char for line in | |
openfile for char in line.lower() ).items()) | |
f = open(sys.argv[1]) | |
for letter, repetitions in filecharcount(f): | |
print(letter, repetitions) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment