Chapter 2: Control FlowΒΆ

In this chapter you will be introduced to common tools that can be found in many coding languages. These tools will allow you to implement more complex logic in your Python programs. It all has to do with something known as flow of control. Some of the things you will learn about include:

  • boolean data type (True and False)

  • operators

    • comparison operators (==, !=, >, <, >=, <=)

    • logical operators (and, or, not)

    • membership operators (in, not in)

  • if, elif, and else statements

  • lists

    • indexing and slicing

    • getting length of a list with len()

    • appending to a list with append() and extend() methods

    • list concatenation with + operator

    • intro to mutable and immutable objects

  • for loops and while loops

  • range() function

  • break and continue and pass statements

  • more Python basic operators

    • % modulus

    • +=, -=, *=, /=