Map
Link to my github (This is learning code.)
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("Dec"))
print(monthConversions.get("AAA"))
print(monthConversions.get("BBB", "Not a value key"))
monthConversions = {
1: "January",
2: "February",
3: "March",
4: "April",
5: "May",
6: "June",
7: "July",
8: "August",
9: "September",
10: "October",
11: "November",
12: "December",
}
print(monthConversions[5])
print(monthConversions.get(11))
print(monthConversions.get("AAA"))
print(monthConversions.get("BBB", "Not a value key"))