Please enable JavaScript to use CodeHS

AP Computer Science Principles in Python

Lesson 4.7 General For Loops

Description

In this lesson, students will explore in more detail how they can modify the initialization statement, test statement, and increment statement in a for loop.


Objective

Students will be able to:

  • Explain the different parameters of the range function (starting value, ending value, and incrementer)
  • Create for loops that iterate differently than the basic for loop structure (ie count by twos or count backwards)