Utilizor
Contact Us

Python Dictionaries

Key-value pairs.

Examples

Create Dictionary

Key:Value pairs.

thisdict = {
  "brand": "Ford",
  "model": "Mustang",
  "year": 1964
}
print(thisdict)

Access Items

Access by key.

thisdict = {
  "brand": "Ford",
  "model": "Mustang",
  "year": 1964
}
x = thisdict["model"]
print(x)

Change Values

Updating a value.

thisdict = {
  "brand": "Ford",
  "model": "Mustang",
  "year": 1964
}
thisdict["year"] = 2018
print(thisdict)

Test Your Knowledge

Python Quiz

No quiz available for this topic yet.