Save
...
mock
programing
list
Save
Share
Learn
Content
Leaderboard
Share
Learn
Created by
emily d
Visit profile
Cards (12)
What is the purpose of lists in programming?
To store multiple items in a single
variable
View source
How is a list declared in a similar fashion to variables?
By using
square brackets
to define items
View source
What does accessing data in lists involve?
Using
square brackets
with an
index
View source
What is the starting index for items in a list?
0
View source
What is the purpose of the append method in lists?
To
add
an item to the end of the list
View source
How would you add "yellow" to a list of colors?
colors.
append
("yellow")
View source
What does the remove method do in lists?
It
deletes
a
specified
item
from
the
list
View source
How would you remove "blue" from a list of colors?
colors.remove
("
blue
")
View source
What does the pop method do in lists?
It removes and returns an item at a specified
index
View source
How would you use pop to remove the first color?
colors
.pop(0)
View source
What is the output of colors.pop(0) if colors = ["red", "blue", "green"]?
"
red
"
View source
What are the key operations you can perform on lists?
Accessing items by
index
Adding items with
append
Removing items with remove and pop
Iterating through items in a loop
View source