Please enable JavaScript to use CodeHS

AP Computer Science Principles in Roblox

Lesson 2.7 For Loops

Description

In this lesson, students will learn about for loops. For loops are used to repeat code a fixed number of times. Students will learn how to create and use for loops and how to decide whether a for loop or a while loop is required for the situation.


Objective

Students will be able to:

  • Create for loops in Lua
  • Explain the purpose of for loops
  • Utilize for loops to avoid typing out repeated code