Skip to content

KOBIC 차세대 생명정보 교육 파이썬기초편 8강 #
Find similar titles

연습문제 답 #

1 #

with open(filename, 'r') as infile:
          words = infile.read().split()
max_len = len(max(words, key=len))
return [word for word in words if len(word) == max_len]
print(longest_word('test.txt'))

2 #

from collections import Counter
with open(fname) as f:
            return Counter(f.read().split())

print("Number of words in the file :",word_count("test.txt")
0.0.1_20210630_7_v33