Functions

So we're going practice functions until we dream them at night. Functions are blocks of code which contains a specific set of instructions when called. What do you mean "when called"? Well after we create a function we have to explicitly use the function so that the code will run.

print('Hey, I\'m the Pink Power Ranger') # We call the print function

In the above example we call the print function. A function is called by using it's name and providing any arguments i.e. inputs, in this case the greeting being printed. After we create our functions, we'll have to call them in the same way we call the print function.

Last updated