DICTS IN PYTHON - GitHub Pages
DICTS IN PYTHON
Peter Larsson-Green
J?nk?ping University
Autumn 2018
DICTS (DICTIONARIES)
Used to store multiple values.
? Each value is associated with a key.
? Expressions creating dicts:
{}
{
:
}
{
:
,
:
}
DICTS (DICTIONARIES)
Used to store multiple values.
? Expression retrieving an item from a dict:
[
]
? Statement adding an item to a dict (or update an existing):
[
] =
EXAMPLE
my_dict = {'one': 1, 'two': 2}
my_dict['three'] = 3
four = my_dict['one'] + my_dict['three']
w = {0:0}[0]
z = {0:{0:0}}[0][0]
two = {0:{1:2}}[0][1]
{
0
[
]
{0:0}
[
0
]
:
0
}
................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related download
- how to iterate over dictionary values in python
- python iterate dictionary value list
- python iterate nested dictionary key value
- collection of key value pairs github pages
- dictionaries and functions
- dictionaries in python
- python getting started
- dicts in python github pages
- how to iterate over dictionary keys in python