Computer >> 컴퓨터 >  >> 프로그램 작성 >> Python

Python - print()의 끝 매개변수

<시간/>

파이썬의 print() 함수는 항상 개행을 생성합니다. 그러나 끝에 새 줄 대신 다른 문자를 넣을 수 있는 이 함수에 대한 매개변수도 있습니다. 이 기사에서는 이 매개변수에 대한 다양한 옵션을 살펴보겠습니다.

예시

아래 예에서 end 매개변수에 값을 할당하고 그 결과를 볼 수 있는 다양한 방법을 볼 수 있습니다.

print("Welcome to ")
print("Tutorialspoint")

print("Welcome to ", end = ' ')
print("Tutorialspoint")

print("emailid",end='@')
print("tutorialspoint.com")

출력

위의 코드를 실행하면 다음과 같은 결과가 나옵니다. -

Welcome to
Tutorialspoint
Welcome to Tutorialspoint
emailid@tutorialspoint.com