Skip to content

Instantly share code, notes, and snippets.

@KimBoWoon
Created January 19, 2015 12:47
Show Gist options
  • Save KimBoWoon/4a644d85c7e0b537c652 to your computer and use it in GitHub Desktop.
Save KimBoWoon/4a644d85c7e0b537c652 to your computer and use it in GitHub Desktop.
Dancing
import os
import sys
targetFile = open("C:\\test\\diary.txt", "r", encoding="utf-8")
count = 0
text = list(str(targetFile.readlines()).upper())
str1 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
for x in str1:
if (text.count(x) > count):
count = text.count(x)
for x in str1:
if (text.count(x) == count):
print("문자는 : ",x, "이고 빈도수는 ",count, " 입니다")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment