티스토리 뷰
반응형
파이썬에는 사전 (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
- React-router
- mobx
- Python
- data grid component
- Spring Boot
- 파이썬
- 파이썬3
- JSON
- facebook login
- angular router
- data component
- Spring
- data table component
- JavaScript
- Java
- https://www.tistory.com/auth/logout/
- Angular
- jQuery
- localStorage
- data gird component
- MySQL
- python3
- CSS
- JPA
- 페이스북 로그인
- data component module
- Redux
- Router
- react
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
글 보관함