python example python example 2

Welcome to

Functions

A function is a predefined piece of code which is grouped together and can be called throughout the code without the whole block of code needing to be repeated. They make programs more efficient and smaller in size. Functions are defined using the keyword def followed by the functions name and to be called you need to input the function name followed by (). Functions are vital for a program with repeated code.