Dictionaries in Python

What is Dictionary in python?
  • Dictionary is an unordered collection of data in the form of key-value pair.
  • First element in the key-value pair is the key and the second element is the value.
  • Like list, dictionaries are mutable.
Creating a dictionary
  • Dictionaries are written inside curly brackets ({}) with comma-separated key-value pairs.