Last active
August 29, 2015 14:18
-
-
Save zrhans/b626a480fdc37989ba43 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# criando um dicionário vazio | |
>>> dict_atm = {} | |
>>> dict_atm | |
{} | |
# criando um dicionário com valores | |
>>> dict_atm = {'precip': 88, 'radiation': 687} | |
>>> dict_atm | |
{'precip': 88, 'radiation': 687} | |
# resgatando valor pela chave | |
>>> dict_atm['precip'] | |
88 | |
# criando um 'mix' dict | |
>>> dmix = {'id': 1, 1: 'id', 'var_atm': dict_atm, lista': [1, 2, 3, 4]} | |
# representação não ordenada | |
>>> dmix | |
{1: 'id', 'lista': [1, 2, 3, 4], 'id': 1, 'var_atm': {'precip': 88, 'radiation': 687}} | |
>>> dmix['lista'] | |
[1, 2, 3, 4] | |
>>> dmix['var_atm'] | |
{'precip': 88, 'radiation': 687} | |
>>> dmix['var_atm']['radiation'] | |
687 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment