Invisible link to canonical for Microformats

Dict


Dictionary

Dictionary is an ordered collection whose values can be changed.

  • Duplicates not allowed.
  • Written as key:value pairs.
  • Allows any data type.
  • Belongs to dict class.

len() is used to find out dictionary length.

songs = {
    "bastille" : "Good Grief",
    "The Smashing Pumpkins" : "1979",
    "Walk" : "Kwabs"
}
print(len(songs)) # 3