👉 딕셔너리를 이용한 제일 많이 등장한 단어 찾기
f = open('friends101.txt', 'r') lst = [] for line in f : words = line.split() for word in words : lst.append(word) print(max(set(lst), key=lst.count))
여기서 💥뽀인뜨💥는 max함수에 key값으로 count메서드를 적용한 것
max
key
count