Back to Lesson
Rapid Mutability Protections
Lock data using frozenset constructs.
Instructions
- Given listsand
l1 = [1, 2, 3].l2 = [3, 4, 5] - Create a dictionary.
metrics = {} - Initialize afrom
frozensetas a key mapped to the stringl1. Initialize another"V1"fromfrozensetmapped tol2."V2" - Print.
metrics[frozenset([1, 2, 3])]
main.py
main.py
Ctrl + Enter