3.13 Developing Procedures - Syntax Terrors

Developing vs. Calling a Procedure

Key Points

  • Developing a procedure means writing the code for what it does.

  • Calling a procedure means using it in your program.

  • You must develop (define) a procedure before you can call it.

JavaScript


// Developing (defining) the procedure
function double(num) {
    console.log(num * 2);
}
// Calling the procedure
double(5);


          

Developing a procedure is when you write the function itself, including its name, parameters, and instructions.

  • Example: function double(num) { console.log(num * 2); }

Calling a procedure is when you use its name to make it run.

  • Example: double(5);

Python


# Developing (defining) the procedure
def double(num):
    print(num * 2)
# Calling the procedure
double(5)


          

Developing a procedure is when you write the function, including its name, parameters, and instructions.

  • Example: def double(num): print(num * 2)

Calling a procedure is when you use its name to make it run.

  • Example: double(5)