Notice
Recent Posts
Recent Comments
목록end (1)
-
[Python] print 문의 옵션 (sep, end, format, escape)
1. sep(seperation) 출력할 요소들을 분리해서 출력하는 옵션이다. 중간중간에 뭐가 들어갈지 지정해줄 수도 있다. print("a", "b", "c", sep='') print("a", "b", "c", sep='/') print("a", "b", "c", sep='@@') # 출력 결과 abc a/b/c a@@b@@c 2. end end 를 사용하면 그 다음의 출력값과 이어서 출력한다. 파이썬은 프린트시에 자동 개행이 되므로, 이를 무시하고 싶을 때 자주 사용한다. print("hello", end='') print("world") # 출력 결과 helloworld print("hello", end='!!!!! ') print("world") # 출력 결과 hello!!!!! world 3...
Python
2022. 5. 11. 11:41