Tagged: Dicts


Python: Dictionaries and JSON

Dictionaries Dictionary – a collection of keys and values, unordered, changeable and indexed. Dictionary comprehensions Creating a dictionary from the list of keys with default value: Dictionary from list of keys and list of values: get(<key>,<value if does not exist>) If we try to get value from the non-existing key, KeyError Exception will be raise. To avoid the crush because of...


Python Basics: Strings, Lists, Dicts, Functions

Kind of Cheat Sheet for anything basic, that I did not know, have not used or interesting things, that good to know. I will keep it handy for a quick reference. I am going to create separate posts for some Python features. Strings Lists Dictionaries Functions