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

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)
  • 방명록

index (1)
[Python] index

index에 대해 간략하게 알아보도록 하겠습니다. index는 문자열 변수의 값에 몇 번째 인덱스부터 몇 번째 인덱스까지 자르거나 배열의 몇 번째 인덱스 뒤에 추가할 값을 넣어 배열을 완성시킬지 등 여러 상황에서 사용되며 중요합니다. 각각의 인덱스에 어떤 값이 있는지 아래 예제를 통해 확인해 보겠습니다. index는 0부터 시작합니다. a = 'python'# 0 or -6 value : p# 1 or -5 value : y# 2 or -4 value : t# 3 or -3 value : h# 4 or -2 value : o# 5 or -1 value : nprint(a[0:6])# 결과: pythonprint(a[1:6])# 결과: ythonprint(a[-6:])# 결과: pythonprint(a[-..

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

Blog is powered by Tistory / Designed by Tistory

티스토리툴바