728x90 반응형 endsWith1 파이썬(Python) Numpy 문자열 찾기 문자열 찾기 목차 find rfind startswith endswith in, not in find 문자열을 찾으면 위치를 그렇지 않으면 -1을 리턴합니다. 코드 string = 'Python is powerful' print(string.find('P')) print(string.find('pow')) 출력 0 10 코드 string = 'Python is powerful' idx = string.find('powerful') if idx == -1: print('Not found') else: print('Find index : ', idx) 출력 Find index : 10 rfind 문자열 뒤에서 부터 검색하며 찾으면 위치를 그렇지 않으면 -1을 리턴합니다. 코드 string = 'Python .. 2021. 9. 4. 이전 1 다음 728x90 반응형