lists Flashcards
1
Q
function to add something to a list
A
variable.append(“ice cream”)
2
Q
function to remove something from a list
A
variable.remove(“hotdog”)
3
Q
remove last item from list
A
variable.pop()
4
Q
add something into a list in a given position
A
food.insert(0, “cake”)
5
Q
sort list alphabetically or numerically
A
variable.sort()
6
Q
clear list
A
variable.clear()