반응형
파이썬 줄 바꾸는 방법
- 1번 - \n
a = 'Life is too short, \nYou need Python'
print(a)
출력값:
Life is too short,
You need Python
- 2번 - '''
a = '''Life is too short,
You need Python'''
print(a)
출력값:
Life is too short,
You need Python
- 3번 - """
a = """Life is too short,
You need Python"""
print(a)
출력값:
Life is too short,
You need Python

반응형
'12. Python' 카테고리의 다른 글
| [파이썬 기본편_10] 문자열 더해서 연결하기 (0) | 2023.08.24 |
|---|---|
| [파이썬 기본편_9] 역슬래시 \ 기능 모음 (0) | 2023.08.22 |
| [파이썬 기본편_7] 문자로 인식하게 만드는 법 (0) | 2023.08.22 |
| VSCode에서 터미널(Terminal) 출력값 삭제하는 단축키(윈도우, 맥) (0) | 2023.08.22 |
| [파이썬 기본편_6] 사칙연산(더하기, 빼기, 곱하기, 나누기, 몫) (0) | 2023.08.22 |