파이썬
[Python] upper, lower | 문자열 대소문자 변경
마스터뢕트
2024. 8. 3. 00:32
문자열 전부 대문자로 변경 upper()
hello = 'hello WORLD'
print(hello.upper()) # HELLO WORLD
- `upper()`: 모든 문자를 대문자로 변경해준다.
문자열 전부 소문자로 변경 lower()
print(hello.lower()) # hello world
- `lower()`: 모든 문자를 소문자로 변경해준다.