--Sequence type --List --Tuple --Mapping type --Dictionary
How to define a list
[value1, value2, value3, ... , valueN]
Tuple
(value1, value2, ..., valueN)
Data type that does not allow duplicate elements
set
{Element 1,Element 2,Element 3, ...,Element n}
function | Contents |
---|---|
add(element) | elementを追加 |
remove(element) | elementを削除 |
clear() | Empty the set |
notation | Contents |
---|---|
set1 | set2 | sum |
set1 & set2 | product |
set1 - set2 | difference |
set1 ^ set2 | Exclusive OR? |
So-called associative array, hash.
How to define a dictionary
{
key1 : value1,
key2 : value2,
...
keyN : valueN
}
Recommended Posts