일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- Django
- c언어문자열
- popupmenubutton
- python3
- 노마드코더
- 강원도속초맛집
- Python
- 부스트코스
- JavaScript
- 추상클래스
- 정렬알고리즘
- 코딩독학
- 아스키코드
- pipenv
- FLUTTER
- BeautifulSoup
- 가상환경
- 자바
- 건대입구맛집
- DOM
- 성수동카페
- 상속
- 컴퓨터과학
- 장고
- richtext
- 남양주맛집
- 속초여행
- 포인터
- removetooltip
- 알고리즘
- Today
- Total
YUYANE
Python/ Sequence Type (list, dictionary) 본문
Sequence Type(열거형)
1) list
- 많은 값을 하나의 list에 저장해보자
days = ["Mon","Tue","Wed","Thur","Fri"]
print("Mon" in days) = True
print(days[3]) = Thur
len(days) = 5
- 다양한 타입 저장 가능
something =["tnjkd", True, 12, None]
- mutable(변경 가능)
days.append("Sat")
["Mon","Tue","Wed","Thur","Fri", "Sat"]
2) tuple
days = ("Mon","Tue","Wed","Thur","Fri")
- immutable
3) Dictionary
- key : value 로 이루어진 Mapping 타입이다.
- nico = {
"name": "Nico",
"age": 29,
"Korean": True,
"fav_food": ["Kimchi", "Sashimi"]
}
- print(nico["name"])=Nico
- 새로운 값을 추가하고 싶을 때
nico["handsome"] = True
- Mutable
참고 예제
people = [
{'name':'jun', 'age':30},
{'name':'jun', 'age':30},
{'name':'jun', 'age':30},
]
**Python 문서
The Python Standard Library — Python 3.9.1 documentation
The Python Standard Library While The Python Language Reference describes the exact syntax and semantics of the Python language, this library reference manual describes the standard library that is distributed with Python. It also describes some of the opt
docs.python.org
**
'Programming Languages > PYTHON' 카테고리의 다른 글
Python / 반복문 (0) | 2020.12.16 |
---|---|
Python / 조건문 (0) | 2020.12.16 |
Python/ function (0) | 2020.12.15 |
Python/ Functions (0) | 2020.12.14 |
Python/ 변수에 저장할 수 있는 타입 (0) | 2020.12.14 |