Loading topic
int, str and bool, and you should be able to write a for loop and an if statement. You should also be comfortable calling functions and methods.2 min readfor loop. It covers reading single items. Reading ranges of items is the topic of the next chapter.2 min readfruits[0] and fruits[-1], and that you know lists are mutable. Slicing extends indexing from one item to a range of items.2 min readappend, extend and insert. It assumes you can run Python code, use the basic types int, str and bool, write for loops and if statements, and call methods.2 min readfor loops and if statements. You will learn three tools for searching a list: the in operator, the index method and the count method.2 min readappend change a list in place. It covers sort, sorted, reverse and reversed, and the key and reverse arguments.2 min readfor loops, if statements, and the basic list operations from earlier chapters: indexing, slicing, and methods like append and remove.2 min readfor loop with an if statement, and that you know how to build a list with append. A list comprehension is a compact expression that builds a new list from any iterable.2 min readappend. It covers why changing one list sometimes changes another, and how to get an independent copy.2 min readfor loops. It collects the bugs that come up most often. Each one has a cause you can name and a fix you can apply.2 min readappend, insert, pop, remove and in. It explains why some of those operations stay fast as a list grows and others slow down.2 min readappend, and pop. It also assumes you know that some list operations cost more than others. Here you will use a list as a stack, see why it makes a poor queue, and switch to collections.deque when you need a queue.2 min read