Bạn đang xem thử công khai
Đăng nhập để lưu tiến độ, làm bài tập, thảo luận và nhận phản hồi.
After this unit you will: choose the right collection type for each problem.
| Type | Ordered | Mutable | Duplicates |
|---|---|---|---|
List [] | Yes | Yes | Allowed |
Tuple () | Yes | No | Allowed |
Set {} | No | Yes | Not allowed |
Dict {k: v} | Yes | Yes | Keys are unique |
(50,).students["s1"]["name"].int(3.99) is 3 — int() truncates the decimal part rather than rounding.