티스토리 뷰
반응형
파이썬에는 사전 (Dictionary)라는 특이한 자료형이 있다.
간단히 하면 키과 값으로 이루어진 list이다. (JAVA의 Map 같은?)
{Key1:Value1, Key2:Value2, Key3:Value3 ...}
예를들어
smalldic = {'dictionary' : 'reference', 'python' : 'snake'}
# python의 key 값에 들어있는 value 확인
>>> smalldic['python'] || smalldic.get('python')
'snake'
# python의 key가 있는지 확인
'python' in smalldic
True # True False로 나온다
#원소삭제
del smalldic['python']
# value로 key값 찾기
>for ke, val in smalldic.items():
if val == 'snake':
print(ke)
반응형
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- Router
- Python
- data grid component
- 페이스북 로그인
- data table component
- data gird component
- JPA
- 파이썬
- facebook login
- jQuery
- mobx
- https://www.tistory.com/auth/logout/
- data component
- python3
- Spring
- react
- angular router
- JSON
- 파이썬3
- Java
- MySQL
- Redux
- Angular
- CSS
- localStorage
- Spring Boot
- React-router
- JavaScript
- data component module
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 29 | 30 | 31 |
글 보관함