{"id":2991,"date":"2023-10-19T19:52:37","date_gmt":"2023-10-19T14:22:37","guid":{"rendered":"https:\/\/python-programs.com\/?p=2991"},"modified":"2023-11-10T11:48:43","modified_gmt":"2023-11-10T06:18:43","slug":"python-dictionary-with-multiple-values-per-key","status":"publish","type":"post","link":"https:\/\/python-programs.com\/python-dictionary-with-multiple-values-per-key\/","title":{"rendered":"Python: Dictionary with Multiple Values per Key"},"content":{"rendered":"

How we can create a dictionary with multiple values per key in python.<\/h2>\n

In python a dictionary is one of the important datatype which is used to store data values in key : value<\/code> pair. Generally keys and values are mapped one-to-one. But it is not impossible that we can not map multiple values to a single key. So in this article we will discuss how we can map multiple values per key in dictionary.<\/p>\n

Syntax of dictionary :<\/strong><\/p>\n

dictionary_name = {key1: value1, key2: value2}<\/pre>\n

where,<\/p>\n