Acceso a elementos del diccionario en Python
thisdict = {
"brand": "Ford",
"model": "Mustang",
"year": 1964
}
x = thisdict["model"]
Poised Pig
thisdict = {
"brand": "Ford",
"model": "Mustang",
"year": 1964
}
x = thisdict["model"]
>>> mydict["Apple"]
{'American': '16', 'Mexican': 10, 'Chinese': 5}
IN PYTHON
unlike javascript don't use . operator to create/assign dic. keys to value
use dic[key] syntax not dic.key(like java script)
NOTE:
in pythyon oops we only use . operator to access methods and attributes
and to even access using reference variable like head in linkedlist