Python: Iterate Dictionary
Go Thru Keys
dd = {"john": 3, "mary": 4, "joe": 5} for kk in dd: print(kk) # john # mary # joe
Go Thru Key and Value
# Loop thru a dictionary, get both key and value. dd = {"john": 3, "mary": 4, "joe": 5} for kk, vv in dd.items(): print(kk, " is ", vv) # john is 3 # mary is 4 # joe is 5
Python, Data Structure
- Python: List
- Python: Generate List: range
- Python: List Comprehension
- Python: List Methods
- Python: Iterate List
- Python: Map f to List
- Python: Filter List
- Python: Iterator to List
- Python: Copy Nested List, Shallow/Deep Copy
- Python: Sort
- Python: Dictionary
- Python: Iterate Dictionary
- Python: Dictionary Methods
- Python: Tuple
- Python: Sets, Union, Intersection
- Python: Sequence Types
- Python: Read Write JSON