help(print)로 print 함수 설명을 보면, 파라미트 중 `end=`가 있다.
1 2 3 4 5 6 7 8 9 10 11 | '''Help on built-in function print in module builtins: print(...) print(value, ..., sep=' ', end='\n', file=sys.stdout, flush=False) Prints the values to a stream, or to sys.stdout by default. Optional keyword arguments: file: a file-like object (stream); defaults to the current sys.stdout. sep: string inserted between values, default a space. end: string appended after the last value, default a newline. flush: whether to forcibly flush the stream.''' |
end 파라미터를 프린트될 구문 마지막에 올 값을 정한다.
기본 값은 줄바꿈인 ( \n ) 이다. 다양하게 바꿀 수 있다.
참고로, \n은 이 출력 결과 자체가 눈에 보이지 않아도 len=1이다.
0 Comments
Post a Comment