make_word_count("frankenstein.txt")
Traceback (most recent call last):
File "", line 1, in
make_word_count("frankenstein.txt")
File "", line 7, in make_word_count
word_dic[word] = dow.count(word)
KeyboardInterrupt
다른 텍스트 는 돌리면 정상적으로 결과값이 출력되는데
똑같이 영어로 작성된 파일인데
다른건 정상적으로 단어:숫자 나오는데
빨간 네모 눌러서 멈춰야되고 이런 메시지 나오는거임?
해당 코드임
def make_word_count(string1):
txt1 = string1.lower()
file1=open(txt1)
word_dic = {}
dow = file1.read().split()
for word in dow:
word_dic[word] = dow.count(word)
file1.close()
return word_dic
댓글 1