January 3, 2022
Yesterday κ°μ¬κ° μ μ₯λμ΄ μλ ν μ€νΈ νμΌμ μ½μ΄ κ°μ¬μ μ¬μ©λκ³ μλ λ¨μ΄λ€μ λͺ©λ‘μ μνλ²³ μμλ‘ μΆλ ₯νκ³ , κ° λ¨μ΄λ€μ΄ λͺ κ°μ© μ¬μ©λκ³ μλμ§ λ¨μ΄λ³ κ°μλ₯Ό μΆλ ₯νλ νλ‘κ·Έλ¨ μμ±
`f1=open('yesterday.txt', 'r')`
total=''
while True:
line = f1.read()
if not line:
break
strings = line.strip('\\n')
total += (strings+' ')
low_total = total.lower()
words_list=set(low_total.split())
words_list=sorted(words_list)
words=low_total.split()
result = {}
for i in words_list:
cnt= words.count(i)
result= {i : cnt}
print(result)
`f1.close()`