Python Dictionary Definition:
Dictionary is collection of key and value pairs. These key value pairs need not be in any specific order. But dictionaries mutable and indexed.
Example: Creating Month Conversion using Dictionary concept
monthConversions = {
===>"Jan": "January",
===>"Feb": "February",
===>"Mar": "March",
===>"Apr": "April",
===>"May": "May",
===>"Jun": "June",
===>"Jul": "July",
===>"Aug": "August",
===>"Sep": "September",
===>"Oct": "October",
===>"Nov": "November",
===>"Dec": "December"
}
print(monthConversions["Nov"])
print(monthConversions.get("Nov"))
print(monthConversions.get("Lov"))
print(monthConversions.get("Lov", "Invalid Key"))
Result:
November
November
None
Invalid Key