find1 문자열 1. 문자열 입력 - input() 함수 이용. input_word=input() print(input_word) 결과 >> hello hello - 문자열은 1차원 배열과 같다. - 만약 문자열의 첫 번째 문자를 참조하기 위해서는 0번지를 참조. - 문자열의 k 번째 문자를 참조하기 위해서는 k-1번지를 참조. input_word=input() print(input_word[0]) # 1번째 문자 print(input_word[2]) # 3번째 문자 결과 >> hello h l 2. 문자열의 길이 - len() 함수 이용 input_word=input() print(len(input_word)) 결과 >> banana 6 3. 공백을 포함한 문자열 - 입력한 문자열이 hello world일 때 - 입력.. 2022. 11. 3. 이전 1 다음