0 points

Create dictionary of months by using keywords and shorthand that prints full month name


dashboard

Mon Mar 30 2020 12:10:17 GMT+0000 (UTC)

Posted by @bambifruit #python #python #dictionary #keys

month_conversion = {
“Jan” = “January”
“Feb” = “February”
“Mar” = “March”
“Apr” = “April”
“Jun” = “June”
}
# keys must be unique:
print(month_conversion[“Mar”])


Output”
           March
content_copy Copy

keys like "Jan", "Feb" we can use anything as a key but must be unique we can't use the same key for two items. Curly braces are mostly used in dictionaries.

https://www.youtube.com/watch?v=rfscVS0vtbw&t=5s