[Python] upper, lower | 문자열 대소문자 변경
- 파이썬
- 2024. 8. 3.
문자열 전부 대문자로 변경 upper()
hello = 'hello WORLD'
print(hello.upper()) # HELLO WORLD
- `upper()`: 모든 문자를 대문자로 변경해준다.
문자열 전부 소문자로 변경 lower()
print(hello.lower()) # hello world
- `lower()`: 모든 문자를 소문자로 변경해준다.
'파이썬' 카테고리의 다른 글
[Python] replace | 문자열 변경하기 (0) | 2024.08.07 |
---|---|
[Python] 슬라이싱 | 문자열 자르기 (0) | 2024.08.06 |
[Python] 다른 언어와 다른 것들 #완전 기초 문법 (0) | 2024.08.05 |