ⓒ 2025 AI교육연구회 withseok. All rights reserved. (위드석)
[블로그 글 내용 상업적 이용금지] 위드석홈 | 위드석개발 | AI교육연구회

다운로드

텍스트파일쓰기모드.py
0.00MB

f=open('today.txt','w',encoding='utf-8')
vToday=input('오늘은 기분이 어떠세요?')
f.write(vToday)
f.close()

다운로드

텍스트파일쓰기모드이어쓰기.py
0.00MB

f=open('today.txt','a',encoding='utf-8')
vToday=input('오늘은 기분이 어떠세요?')
f.write(vToday)
f.close()

다운로드

텍스트파일쓰기-줄바꿈.py
0.00MB

f=open('today.txt','a',encoding='utf-8')
     # a : 이어쓰기 모드
vToday=input('오늘은 기분이 어떠세요?')
f.write('\n'+vToday+'\n')
    #줄바꿈 추가
f.close()
320x100

+ Recent posts