Toggle theme
문제를 잘 정의하는 것은 문제를 절반 해결한 것이다. - 2023.12
사용자 도구
Toggle theme
로그인
사이트 도구
검색
도구
문서 보기
이전 판
PDF로 내보내기
Fold/unfold all
역링크
최근 바뀜
미디어 관리자
사이트맵
로그인
>
최근 바뀜
미디어 관리자
사이트맵
현재 위치:
start
»
wiki
»
ai
»
python
»
print_함수의_이해
wiki:ai:python:print_함수의_이해
이 문서는 읽기 전용입니다. 원본을 볼 수는 있지만 바꿀 수는 없습니다. 문제가 있다고 생각하면 관리자에게 문의하세요.
====== print함수의 이해 ====== <WRAP left notice 80%> * description : python에서의 print 함수 이해 * author : 도봉산핵주먹 * email : hylee@repia.com * lastupdate : 2020-06-17 </WRAP> <WRAP clear/> ===== print함수의 이해 ===== ==== 예제 코드 ==== <code python> # Section02-1 # 파이썬 기초 코딩 # Print 구문의 이해 # 참조 : https://www.python-course.eu/python3_formatted_output.php """ 참고 : Escape 코드 \n : 개행 \t : 탭 \\ : 문자 \' : 문자 \" : 문자 \r : 캐리지 리턴 \f : 폼 피드 \a : 벨 소리 \b : 백 스페이스 \000 : 널 문자 ... """ # 기본 출력 print("=== 기본 출력 ===") print('Hello Python!') # 문법적 중요 print("Hello Python!") # 텍스트 의미 print("""Hello Python!""") print('''Hello Python!''') print() # separator 옵션 사용 print("=== separator 옵션 ===") print('T', 'E', 'S', 'T', sep='') print('2019', '02', '19', sep='-') print('niceman', 'google.com', sep='@') print() # end 옵션 사용 print("=== end 옵션 ===") print('Welcome To', end=' ') print('the black parade', end=' ') print('piano notes') print() # file 옵션 사용 import sys print("=== file 옵션 ===") print('GeeksForGeeks', file=sys.stdout) print() print("%s's favorite number is %d" % ('hylee', int(6))) # format 사용 print("=== format 사용 ===") print('{} and {}'.format('You', 'Me')) print('{0} and {1} and {0}'.format('You', 'Me')) print('{var1} are {var2}'.format(var1='You', var2='Niceman')) print() print(r"=== %d, %f, %s 사용 ===") # %d, %f, %s print("Test1: %d, Price: %.2f" % (776, 6534.123)) print("Test2: {0:2d}, Price:{1:4.2f}".format(776, 6534.123)) print("Test3: {a: d}, Price:{b: 2.1f}".format(a=776, b=6534.123)) </code> ==== 실행 콘솔 ==== <code console> === 기본 출력 === Hello Python! Hello Python! Hello Python! Hello Python! === separator 옵션 === TEST 2019-02-19 hylee@google.com === end 옵션 === Welcome To the black parade piano notes === file 옵션 === GeeksForGeeks hylee's favorite number is 6 === format 사용 === You and Me You and Me and You You are Niceman === %d, %f, %s 사용 === Test1: 776, Price: 6534.12 Test2: 776, Price:6534.12 Test3: 776, Price: 6534.1 </code> ===== Tip ===== {{tag>도봉산핵주먹 python print}}
/volume1/web/dokuwiki/data/pages/wiki/ai/python/print_함수의_이해.txt
· 마지막으로 수정됨: 2023/01/13 18:44 (바깥 편집)
문서 도구
문서 보기
이전 판
역링크
PDF로 내보내기
Fold/unfold all
맨 위로