Notice
Recent Posts
Recent Comments
Link
Susan and Data
파이썬_문자열 관련 함수를 사용해보자! 본문
문자열
[함수]
1. len: 문자의 길이 확인
2. split: 문장 쪼개기
3. replace: 내용 변경
4. lower: 소문자 변경
5. upper: 대문자 변경
6. startwith: ~로 시작하는
7. endswith: ~로 끝나는
8. strip: 앞, 뒤 불필요한 공백 제거
Q. a='banana pen' 문자 길이는?

Q. a='This is a pen' 문장을 쪼개시오.

Q. a='This is a pen' 각각 다른 리턴값으로 출력

Q. This와 is의 값을 합치시오.

Q. 아래의 문장을 단어 단위로 나누시오.(하이픈은 제외)
"A 61-year-old man whose wife worked as O'Connell's housekeeper was charged with one count of murder in the shooting death of the much lauded religious leader."


Q. My name is Teddy 소문자로 변경

Q. My name is Teddy 대문자로 변경

Q. a의 값이 01로 시작하는지 확인
a의 값이 .jpg로 끝나는지 확인
a='01-sample.png'
b='02-sample.jpg'
c='03-sample.pdf'

Q. if조건 활용하여 b번 출력

Q. a='01-sample.png' png를 jpg로 변경

Q. a=' 01-sample.png' 불필요한 공백 제거

'IT > Python' 카테고리의 다른 글
파이썬_list comprehension을 이해해보자! (0) | 2023.03.12 |
---|---|
파이썬_반복문을 활용하여 커피를 주문해보자! (0) | 2023.03.12 |
파이썬_라이브러리를 알아보자! (0) | 2023.03.11 |
파이썬_로그 파일을 생성해보자! (0) | 2023.03.08 |
파이썬_os, shutil, glob 모듈을 활용하여 파일을 분류해보자! (0) | 2023.03.06 |