#파이썬 코딩도장 #7.4 연습문제 #7.5 심사문제
-
4. 출력 방법 알아보기Python/Grammar 2022. 11. 29. 13:00
# 1. 값을 여러 개 출력하기 1-1.sep 파라미터 사용하기 : 값 사이에 공백이 아닌 다른 문자를 넣고 싶을 때 print의 'sep' 파라미터에 문자나 문자열을 지정해주면 된다. sep은 '구분자' seperator를 의미한다. print(값1, 값2, sep='문자 또는 문자열') print(변수1, 변수2, sep='문자 또는 문자열') >>> print(1, 2, 3, sep=', ') # sep에 콤마와 공백 지정 1, 2, 3 >>> print(1, 2, 3, sep='\n') # sep에 개행 문자(\n) 지정 1 2 3 >>> print(4, 5, 6, sep=',') # sep에 콤마만 지정 4,5,6 >>> print('Hello', 'Python', sep='') # sep에 빈..