-
출처 | 파이썬 코딩 도장 27.5 연습문제 (바로가기) with open('words.txt', 'r') as file: count = 0 line = None while line != '': line = file.readline() # readline은 더 이상 읽을 줄이 없을 때 빈 문자열(길이 0) 반환함 # 따라서 길이 0 (빈 문자열) 보다 크고 길이 10 이하인 대상만 숫자셈 if 0 < len(line.strip('\n'))