파이썬공부 3.여러줄인 문자열을 변수에 대입하는 방법
여러줄인 문자열을 변수에 대입하는 방법 우리가 프로그램에서 문자열을 다룰때 꼭 한줄만 있는 문자열이라고 하지 않는다.다음과 같이 여러줄의 문자열을 변수에 대입 하려면 어떻게 처리해야할까? Opportunities are never lost. The other fellow takes those you miss. 1.줄을 바꾸기 위한 이스케이프 코드 '\n' 삽입하기 >>> multiline = "Opportunities are never lost.\nThe other fellow takes those you miss.">>> print(multiline)Opportunities are never lost.The other fellow takes those you miss. 위 예제처럼 \n을 사용하면 개행..
IT 개발/Python
2020. 8. 11. 00:14
반응형