[인공지능 개발] #4. 파이썬 기초(3)_시퀀스타입(리스트,튜플,문자열)
1. Sequene types1-1. 리스트- fruits = ["apple", "banana", "cherry"] print(fruits) print(type(fruits)) print(fruits[2]) # 모든 숫자는 0부터 시작한다. print(fruits[-1]) # -는 뒤에서부터 숫자를 가져온다.출력: ['apple', 'banana', 'cherry' ] 'cherry' 'cherry' - numbers = [100, 200, 300, 400] numbers[1] = 0 #리스트의 값을 변환할 수 있다. numbers.append("500") #리스트의 값을 추가할 수 있다. print(numbers)출력: ['100', '0'..
2024. 10. 13.