Python – Function

Python tutorials for Business Analyst – Python Global, Local and Nonlocal variables

(Python Tutorial – 019) Python Global, Local and Nonlocal variables In this tutorial, you’ll learn about Python Global variables, Local variables, Nonlocal variables and where to use them. Global Variables In Python, a variable declared outside of the function or in global scope is known as a global variable. This means that a global variable …

Python tutorials for Business Analyst – Python Lambda Function

(Python Tutorial – 018) Python Anonymous/Lambda Function In this article, you’ll learn about the anonymous function, also known as lambda functions. You’ll learn what they are, their syntax and how to use them (with examples). What are lambda functions in Python? In Python, an anonymous function is a function that is defined without a name. While normal …

Python tutorials for Business Analyst – Python Recursion

(Python Tutorial – 017) Python Recursion In this tutorial, you will learn to create a recursive function (a function that calls itself). What is recursion? Recursion is the process of defining something in terms of itself. A physical world example would be to place two parallel mirrors facing each other. Any object in between them …

Python tutorials for Business Analyst – Python Function Arguments

(Python Tutorial – 016) Python Function Arguments In Python, you can define a function that takes variable number of arguments. In this article, you will learn to define such functions using default, keyword and arbitrary arguments.   Arguments In the user-defined function topic, we learned about defining a function and calling it. Otherwise, the function call will …

Python tutorials for Business Analyst – Python Functions

(Python Tutorial – 015) Python Functions In this article, you’ll learn about functions, what a function is, the syntax, components, and types of functions. Also, you’ll learn to create a function in Python.   What is a function in Python? In Python, a function is a group of related statements that performs a specific task. …