Python: Convert List to Dictionary
Merge Two Lists into Dictionary
zip(args)
# convert 2 lists into a dictionary, use zip() aa = [1, 2, 3] bb = ["a", "b", "c"] print(dict(zip(aa, bb))) # {1: 'a', 2: 'b', 3: 'c'}
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: Interweave Lists to Tuples, Transpose
- Python: Sort
- Python: Convert List to Dictionary
- Python: Dictionary
- Python: Iterate Dictionary
- Python: Dictionary Methods
- Python: Tuple
- Python: Sets, Union, Intersection
- Python: Sequence Types
- Python: Read Write JSON