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