mirror of
https://github.com/erg-lang/erg.git
synced 2025-09-28 20:14:45 +00:00
14 lines
331 B
Python
14 lines
331 B
Python
immut_dict = {"Alice": 1, "Bob": 2, "Charlie": 3}
|
|
assert immut_dict["Alice"] == 1
|
|
_ = immut_dict["Bob"]
|
|
_ = immut_dict.get("Charlie")
|
|
_ = immut_dict.get("Charlie", 4)
|
|
|
|
for! immut_dict.keys(), k =>
|
|
print! k
|
|
for! immut_dict.values(), v =>
|
|
print! v
|
|
for! immut_dict.items(), ((k, v),) =>
|
|
print! k, v
|
|
|
|
_ = immut_dict.copy()
|