Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- coding test
- 윤성우의 열혈 자료구조
- 알기쉬운 알고리즘
- datastructure
- stream
- 윤성우 열혈자료구조
- insertion sort
- s
- 이것이 자바다
- Algorithm
- buffer
- 메모리구조
- Stack
- Selection Sorting
- 혼자 공부하는 C언어
- Serialization
- C programming
- list 컬렉션
- 이스케이프 문자
- JSON
- R
- Graph
- C 언어 코딩 도장
Archives
- Today
- Total
Engineering Note
[Python] startswith 함수 본문
startswith
- 파이썬의 문자열의 첫 글자 확인을 도와주는 함수이다.
startwith 사용방법
- 문자열.startwith('특정 문자열')
# 트럼프 대통령 트윗을 공백 기준으로 분리한 리스트입니다. 수정하지 마세요.
trump_tweets = ['thank', 'you', 'to', 'president', 'moon', 'of', 'south', 'korea',
'for', 'the', 'beautiful', 'welcoming', 'ceremony', 'it', 'will', 'always', 'be', 'remembered']
def print\_korea(tweet):
# 문자열로 구성된 리스트에서 k로 시작하는 문자열을 출력합니다.
for word in tweet:
if word.startswith('k'):
print(word)
# 아래 주석을 해제하고 결과를 확인해보세요.
print_korea(trump_tweets)
'Programming Language > Python' 카테고리의 다른 글
[Python] 파이썬 함수호출 변수 저장 오류 (0) | 2021.11.18 |
---|---|
[Python] 리스트의 복사 (0) | 2021.09.25 |
[Python] 파이썬 입력 (0) | 2021.07.21 |
[Python] 터미널 run 단축키 python (0) | 2021.06.26 |
[Python] startwith, startend (0) | 2021.06.23 |
Comments