[Python] upper and lowercase letters
대소문자 변환하는 String 메서드에 대해 알아보도록 하겠습니다. 아래 작성한 예제를 통해 확인할 수 있습니다.a = 'Hello world'print("소문자: " + a.lower())# 결과: hello worldprint("대문자: " + a.upper())# 결과: HELLO WORLDprint("대소문자: " + a.swapcase())# 결과: hELLO WORLDb = 'cat dog'print("첫글자만 대문자: " + b.capitalize())# 결과: Cat dogprint("각단어의 첫글자만 대문자: " + b.title())# 결과: Cat Dog대소문자 변환하는 메서드에 대해 알아보았습니다. 끝.
Python
2022. 8. 17. 10:40
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- bool
- Method
- isdigit
- isalpha
- Upper
- Lambda
- combinations
- index
- Built-in Functions
- counter
- for
- function
- zip
- Python
- operators
- find
- If
- Lower
- permutations
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
글 보관함