Functions are basically the block of codes which we have to use multiple times in the program like loops. Functions can reduce the number of lines of codes. Functions are executed when they are called from the main function.