
- Python Basic Tutorial
- Python - Home
- Python - Overview
- Python - Environment Setup
- Python - Basic Syntax
- Python - Comments
- Python - Variables
- Python - Data Types
- Python - Operators
- Python - Decision Making
- Python - Loops
- Python - Numbers
- Python - Strings
- Python - Lists
- Python - Tuples
- Python - Dictionary
- Python - Date & Time
- Python - Functions
- Python - Modules
- Python - Files I/O
- Python - Exceptions
How to define a Python dictionary within dictionary?
A dictionary object is mutable. Hence one dictionary object can be used as a value component of a key. So we can create a nested dictionary object another dictionary object is defined as value associated with key.
>>>> students={"student1":{"name":"Raaj", "age":23, "subjects":["Phy", "Che", "maths"],"GPA":8.5},"student2":{"name":"Kiran", "age":21, "subjects":["Phy", "Che", "bio"],"GPA":8.25}}
- Related Articles
- How do we define dictionary in Python?
- How to convert Javascript dictionary to Python dictionary?
- How to convert a String representation of a Dictionary to a dictionary in Python?
- Convert string dictionary to dictionary in Python
- How to convert the string representation of a dictionary to a dictionary in python?
- How to create Python dictionary from the value of another dictionary?
- How to sort a nested Python dictionary?
- How to update a Python dictionary values?
- How to create a dictionary in Python?
- How to sort a dictionary in Python?
- How to convert Python Dictionary to a list?
- How to convert a spreadsheet to Python dictionary?
- How to create nested Python dictionary?
- How do I serialize a Python dictionary into a string, and then back to a dictionary?
- Python Convert nested dictionary into flattened dictionary?

Advertisements