In this lesson, students are introduced to lists. They learn why lists are used in programs and how to create them. Lists are created like this:
list_name = [item_1, item_2, item_3, ...]
Students will be able to:
In this lesson, students learn about the positive and negative indexing system of lists and how items are accessed in a list.
Students will be able to:
In this lesson, students learn how to update items in lists using the index value of the item.
Students will be able to:
In this lesson, students learn various ways to add items to an existing list with the use of the insert
, extend
, and append
methods.
Students will be able to:
append
method to add a new item to the end of a listextend
method to add new items to the end of a listinsert
method to add a new item at a specific index in a listIn this lesson, students learn various ways to remove items from an existing list with the use of the pop
and remove
methods and the del
keyword.
Students will be able to:
pop
method with no argument to remove an item from the end of a listpop
method to remove an item from a specific index in a listremove
method to remove a specific item from a listdel
keyword to remove an item from a specific index in a listIn this lesson, students learn how to use two new methods, sort
and reverse
, to alter list items.
Students will be able to:
sort
method to organize items in a list by valuereverse
method to reverse the order of items in a listIn this lesson, students review content with a 10 question End-of-Unit Quiz.
Students will be able to:
list_name = [item_1, item_2, ...]
)list_name[index]
)list_name[index] = new_value
)append
extend
insert
+
pop
remove
del
sort
reverse