>>> a = set((1,2,3))>>> a {1, 2, 3}>>> type(a) >>> b = list(a) >>> b [1, 2, 3] >>> type(b)>>> c = tuple(b) >>> c (1, 2, 3)>>> type(c) >>> d = set(c) >>> d {1, 2, 3} >>> type(d) -. in 연산자, 데이터형 내부에 존재하는 값 확인>>> a = set((1,2,3)) >>> 1 in a True >>> b = list(a) >>> 2 in b True >>> c = tuple(b) >>> 3 in c True >>> 4 in a False
집합과 동일,값들의 모임순서는 없음 {} 로 묶어서 정의 >>> a = {1,2,3} >>> b = {3,4,5} >>> a {1, 2, 3} >>> b {3, 4, 5} >>> a,b ({1, 2, 3}, {3, 4, 5}) >>> type(a) -. union(합집합)>>> a.union(b) {1, 2, 3, 4, 5} -. intersection(교집합)>>> a.intersection(b) {3} -. 연산자사용 >>> a - b #차집합 {1, 2} >>> a | b #합집합 {1, 2, 3, 4, 5} >>> a & b #교집합 {3}
값들의 나열,순서가 존재하며 여러 종류의 값을 담을수 있음0부터 시작하는 Index를 가지고 있음슬라이싱 가능 [] 로 묶어서 정의 >>> a = ['red','blue','green'] >>> a ['red', 'blue', 'green'] >>> type(a) -. append>>> a.append('blue') >>> a ['red', 'blue', 'green', 'blue'] -. insert>>> a.insert(1,'black') >>> a ['red', 'black', 'blue', 'green', 'blue'] -. extend>>> a.extend(['white','gray']) >>> a ['red', 'black', 'blue', 'green', 'blue', 'white', 'gr..
>>> type(1) #정수 >>> type(3.14) #실수 >>> type(3-4j) #복소수 >>> type('Hello') #문자 >>> a = ['red','green','gold'] >>> type(a) #리스트 >>> a = {1,2,3} >>> type(a) #세트 >>> a = (1,2,3) >>> type(a) #튜플 >>> a = dict(a=1,b=2) >>> b = {'a':1,'b':2} >>> a {'a': 1, 'b': 2} >>> b {'a': 1, 'b': 2} >>> type(a) #사전 >>> type(b) >>> a = True >>> b = False >>> type(a) #부울(논리값) >>> type(b)
- Total
- Today
- Yesterday
- Composite Key
- vba
- onetomany
- Module
- borderwidth
- tkinter
- ManyToOne
- activebackground
- highlightbackground
- Java
- Linux
- activeforeground
- Private
- tkinter command & bind [명령어묶기와 사건묶기] Python
- fetch join
- Python
- 폼
- FetchType
- disabledforeground
- 상수
- apache
- checkbutton
- JPA
- 파이썬
- IdClass
- command
- highlightthickness
- Excel
- indicatoron
- 리눅스
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |