How to Write Python Functions and Recursion

In this video tutorial, I will teach you how to create and call Python functions.

A function is a small self-contained program (a block of code) that can be called to perform a task. A function is one of the techniques for achieving code re-usability. Functions are used to make your programs concise and reduce the likelihood of introducing bugs into your programs as a result of repetition of statements. 

I also discuss the concept of recursion and how to create a recursive function.A recursive function is one that calls itself. This is a powerful concept in programming. However, if not written properly, it can create an infinite loop.

The general syntax for creating Python functions is as follows: 

def my_function():

C. O. Daniel

C. O. Daniel holds degrees in Computer Science and certifications from CompTIA and Microsoft. His areas of interest include computer networking, cybersecurity and programming.

Leave a Reply