Python Flashcards
append()
Adds element to end of list
clear()
Removes all elements from list
count()
Counts elements in list
index()
Returns index of specified value
remove()
Removes 1st item of specified value
pop()
Removes element from the specified position
insert()
Inserts at a specified position
reverse()
Reverses the list
len()
Gives length
sort()
Sorts alphabetically
split(), in a string. Separates by what? What is the whole comma d.
Puts elements into a list. Separates by spaces. List = “this is a string”.split()
Print every other starts on
The first element
Sort and reverse commands issue
Does it in place so you can’t assign ot a new name because they only return none
range options
One number, or a range of numbers with steps. Ex…for n in range(start_num, end_number,steps)