본문 바로가기 메뉴 바로가기

Good Developer

프로필사진
  • 글쓰기
  • 관리
  • 태그
  • 방명록
  • RSS

Good Developer

검색하기 폼
  • 분류 전체보기 (76)
    • hhplus (6)
    • 개발서적 (4)
    • Error (2)
    • Kafka (1)
    • React (3)
    • Docker (5)
    • Spring (6)
    • Java (27)
    • Project (3)
    • Python (16)
    • DB (3)
    • Github (0)
  • 방명록

Method (1)
[Python] String Method

String Method에 대해 알아보도록 하겠습니다.Method는 함수라고도 하며 어떤 기능의 묶음 뜻합니다.  다양한 메서드 종류와 간단하게 예제를 통해 알아보도록 하겠습니다. 아래 작성한 예제를 통해 확인할 수 있습니다.a = 'Hello world'# 알파벳 'o' 문자가 몇개 인가?print(a.count('o'))# 결과: 2c = 'Hi Python'# 'Hi'로 시작하는지?print(c.startswith('Hi'))# 결과: True# 'Hi'로 끝나는지?print(c.endswith('Hi'))# 결과: Falseprint(c.endswith('Python'))# 결과: True# 문자열 일부 변경print(c.replace('Python', 'JAVA'))# 결과: Hi JAVA# 특..

Python 2022. 8. 25. 16:34
이전 1 다음
이전 다음
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
TAG
  • isdigit
  • for
  • find
  • operators
  • function
  • Upper
  • combinations
  • permutations
  • bool
  • index
  • Built-in Functions
  • zip
  • Lower
  • Lambda
  • If
  • Python
  • counter
  • isalpha
  • Method
more
«   2025/06   »
일 월 화 수 목 금 토
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
글 보관함

Blog is powered by Tistory / Designed by Tistory

티스토리툴바