Skip to content

Commit ee5c82b

Browse files
committed
feat: Add a source code example using dict() to the slides/weektwelve/index.qmd.
1 parent 1934960 commit ee5c82b

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

slides/weektwelve/index.qmd

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -714,6 +714,18 @@ print(f" Email: {hash_map['email']}")
714714

715715
## Wow, similar to Python's dictionary!
716716

717+
```{python}
718+
hash_map = dict()
719+
720+
hash_map["name"] = "Alice Johnson"
721+
hash_map["age"] = 32
722+
hash_map["email"] = "alice@example.com"
723+
724+
print(f" Name: {hash_map.get('name')}")
725+
print(f" Age: {hash_map['age']}")
726+
print(f" Email: {hash_map['email']}")
727+
```
728+
717729
::: fragment
718730

719731
- Similar core operations like `[]`, `get()`, and `put()`

0 commit comments

Comments
 (0)