List / Tuple, Sets/Dictionaries

Lima·2021년 2월 24일
0

python

목록 보기
5/6
post-thumbnail

Lists

Lists are mutable sequences, typically used to store collections of homogeneous items.
Using a list comprehension: [x for x in iterable]

Tuples

Tuples are immutable sequences, typically used to store collections of heterogeneous data.
Tuples are also used for cases where an immutable sequence of homogeneous data is needed (such as allowing storage in a Set or Dict instance).
a tuple with one item is constructed by following a value with a comma.

Sets

unordered collection with no duplicate elements.
Curly braces or the set() function can be used to create sets

Dictionaries

a set of key: value pairs, with the requirement that the keys are unique (within one dictionary).

https://docs.python.org/3/library/stdtypes.html#built-in-types

https://docs.python.org/3/tutorial/datastructures.html#data-structures

https://docs.python.org/3/tutorial/introduction.html#lists

0개의 댓글