[파이썬-문법] print 활용 옵션 정리(sep=, end=, format, escape, raw string, f-string)
조사하는김에 정리 sep='값' : print 출력값 사이 연결 end='값' : print 출력값 이후 출력 값.format() : 특정 값 삽입 escape : \n(개행), \t(탭) 등 sep, end, format 소스 복사해서 출력해보면 느낌이 올거다. #sep print('a', 'b', 'c', sep='$$$$$') #출력값 #a$$$$$b$$$$$c #end print('a', 'b', 'c', end='\n$$$$$\n') #출력값 #a b c #$$$$$ #format print('{} 앤드 {}'.format('coffee', 'donut')) #출력값 #coffee 앤드 donut escape 종류 print 구문에서 특수문자를 표현하려면 \(백슬래시)를 붙여줘야된다. \n : ..
2022. 5. 26.