파이썬집합 #Set

    파이썬 기초 자료형 (8) - 집합(Set)

    1) 집합(Set) 자료형 선언 및 변환 # 집합(Set) 특징 # 집합(Set) 자료형(순서X, 중복X) #선언 a = set() b = set([1,2,3,4]) c = set([1,4,5,6]) d = set([1,2,'Pen','Cap']) e = {'foo','bar','baz','foo','qux'} f = {42, 'foo' , (1,2,3), 3.1244423} print('a - ', type(a), a) print('b - ', type(b), b) print('c - ', type(c), c) print('d - ', type(d), d) print('e - ', type(e), e) print('f - ', type(f), f) print() # 튜플 변환(set -> tuple) ..