GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing www.geeksforgeeks.org — Python dict() Function - GeeksforGeeks Python dict() FunctionLast Updated : 5 Jun, 2026 dict() function is a built-in constructor used to create dictionaries. A dictionary is a mutable collection of key-value pairs where each key is unique and insertion order is preserved.
Output {'One': '1', 'Two': '2'}
Explanation: Here, we create a dictionary using keyword arguments. The keys One and Two are assigned the values "1" and "2" respectively. Syntax
Parameter:
Return: The function returns a dictionary containing the specified key-value pairs.
ExamplesExample 1: Creating shallow copy of the dictionary
Output {'a': 10, 'b': 2, 'c': 3}
{'a': 10, 'b': 2, 'c': 3}
Explanation:
Example 2: Creating dictionary using iterables
Output {'a': 1, 'b': 2, 'c': 3, 'd': 4}
Explanation:
Comment Explore |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |