파이썬
Python List, Dictionary, Tuple, Set(집합)
List #선언, append, del list = [] list.append('joy') list.append('like') list.append(1004) print(list) #출력 : "['joy', 'like', 1004]" del list[1] print(list) #출력 : "['joy', 1004]" #sort list = [3,5,1,2,4] list.sort() print(list) #출력 : "[1, 2, 3, 4, 5]" #len, count list = [1, 3, 3, 4, 5] print(len(list)) #출력 : "5" print(list.count(3)) #출력 : "2" Dictionary #선언 dict = {'name':'joy', 'age':'14', 1004:'..
2021. 11. 18. 19:43
최근댓글