LimioLearn in Flow
🏆 Đấu trường
Đăng nhậpĐăng ký
← Programming for Data Science

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.

Đăng nhập
Module 1: Fundamentals of Python Programming

1.5 List

In / Lưu PDF

1.5 List

After this unit you will: work with lists without falling into the copying trap.

Key points

  • A list is ordered, mutable, and allows duplicates: nums[0] = 99.
  • Adding/removing: append, insert, extend, remove, pop, del, clear.
  • b = a does not make a copy — both names point to the same list. For a real copy, use a.copy().
  • a.sort() sorts in place; sorted(a) returns a new list.