Open kny2383 opened 2 years ago
f=open('final.txt','w',encoding='UTF-8') def check_string(): with open('news.txt',encoding='UTF-8') as temp_f: datafile = temp_f.readlines() for line in datafile: for i in range(0,200): if ulli_total[i] in line:
final[i] = ulli_total[i] f.write(final[i]) f.write('\n') return 0
if check_string(): print("성공") else : print('더이상 해당이름이 없습니다.')
news.txt와 idol.txt 문자열 비교
f=open('final.txt','w',encoding='UTF-8') def check_string(): with open('news.txt',encoding='UTF-8') as temp_f: datafile = temp_f.readlines() for line in datafile: for i in range(0,200): if ulli_total[i] in line:
print("이름: ", ulli_total[i])
if check_string(): print("성공") else : print('더이상 해당이름이 없습니다.')