List1 = [1, 2, 3, 4]
List2 = ['Errormin', 'Dev', 'Ops', 'Cloud']
List3 = [4, 5, ['Azure', 'AWS']]
print(List1[-1])
print(List2[0])
print(List3[0:][1])
#==========================
numbers = []
numbers.append(5)
numbers.append(8)
print(numbers)
print(len(numbers)) #길이재기
#==========================
numbers2 = [1,2,3,4,5,6,7,8,9]
del numbers2[3] #삭제
print(numbers2)
#==========================
numbers3 = [1,2,3,4,5,6,7,8,9]
numbers3.insert(4, 37) #4번 인덱스에 삽입
print(numbers3)
'언어 > Python문법' 카테고리의 다른 글
[python] for문 리스트 반복 (0) | 2022.10.27 |
---|---|
[python] reange 함수 for (0) | 2022.10.27 |
[python] 함수 요약 (0) | 2022.10.27 |
[Python기초] 옵셔널 파라미터 (0) | 2022.08.09 |
[Python 기초]format을 활용한 문자열 포맷팅 (0) | 2022.08.08 |