Please enable JavaScript to use CodeHS

Creative Computing (MS)

Lesson 2.15 How to Indent Your Code

Description

In this lesson, students will learn the proper way to indent their code. Indentation is especially important when using multiple loops, functions, and if statements to show the structure of the code. Indentation provides a good visual approach to see which commands are inside vs. outside of a loop or if statement.


Objective

Students will be able to:

  • Explain why it is important to indent code
  • Identify proper indentation
  • Modify a program to have proper indentation
  • Write programs with proper indentation

Activities

These are all the activities included in the lesson

2.15.1 How to Indent Your Code
2.15.2 How to Indent Your Code Quiz
2.15.3 Dance and Clean Karel
2.15.4 Diagonal
2.15.5 Staircase
2.15.6 Karel Exercises Badge