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 searches
- sort dictionary in python by values
- shape in python numpy
- array shape in python numpy
- str in python example
- join in python using on
- replace character in python string
- create a matrix in python using for
- random generator in python examples
- create matrix in python numpy
- install numpy in python 2 7
- tuple in python example
- numpy in python tutorial