Python functions

A function is a group of statements that exist within a program for the purpose of performing a specific task. Instead of writing a large program as one long sequence of statements, it can be written as several small functions, each one performing a specific part of the task.

A function is a reusable portion of a program, sometimes called a procedure or subroutine.

Why write and use functions?

With functions, there are 2 major points of view


Using functions


Building functions

Calling a function

Scope of Identifiers

Function parameters and using keyword return