728x90 strip1 [python] 기초 - 인덱스, 슬라이싱, 함수, 출력, 리스트 인덱스 (index) / 슬라이싱 (slicing) p y t h o n 0 1 2 3 4 5 -6 -5 -4 -3 -2 -1 str = 'python' str[0] # 인덱스. => 'p' str[3:5] # 슬라이싱. [a:b] ㅡㅡ> a부터 b전까지 => 'ho' 문자열 특수함수 func = "python is easy programming language" func.count('p') # 글자세기 => 2 func.find('p') # 글자위치찾기 => 0 python_is_easy = "python is easy" python_is_easy.replace("python","golang") # 글자바꾸기 => ''golang is easy' some_string = ",,,DaveLee..." s.. 2023. 2. 27. 이전 1 다음 728x90