Blocks

In this lesson, you will be introduced to blocks and learn how to set the scope of a program.

We'll cover the following

In our program for computing the square root of a number, we had to define multiple functions. You might have noticed that most of the functions were very specific to our program and might not be that useful anywhere else. We can better organize our program using a block.

Before we get started, let’s take a look at the code we have written so far.

Create a free account to access the full course.

By signing up, you agree to Educative's Terms of Service and Privacy Policy