Search⌘ K
AI Features

Creating and Calling a Function

Explore how to create and invoke functions in both Python and PowerShell. Understand function definitions, parameters, use of docstrings in Python, and differences like indentation versus braces. This lesson will help you write functions clearly and call them properly using each language's conventions.

We'll cover the following...

Creating a Function

Before we can even use a function, we have to first define it with a name, a set of parameters, and the code block. This is called the function definition. Both Python and PowerShell follow different syntax and keywords, which are as follows.

Python Syntax:

def function_name (one or more comma separated
...