Category Archives: Python – Function

In this category we are going to learn about what is meant by functions in python? Different types of python functions, How to write and call python function in a program. So let’s get started with the definition with the python function.

What is function argument? Global, local and non-local function types of python function.

Python package

In this article we are going to learn about what is python package. How to create a package in python. How to import a module from package also rename while importing. What is significance of file “__init__.py” in package and how package initialization works. What is Package in Python: Python package is a directory with modules in it. Basically when our python code gets bigger then it becomes very difficult to maintain it and the only preventive solution is to keep the code well organized. Write

Read More

Python Modules

In this article we are going to learn about python modules. How to a write a python module. Different ways of importing a python module into a program. Most commonly used built-in python modules and how search path works. What is python module? Python module is a python file containing python definitions and executable statements. Biggest advantage of python module is we can use any python program readily into our program without actual copying the code definitions. When a program gets bigger then it becomes very

Read More

Python Anonymous/Lambda function

In this series of python tutorial we are going to learn next python function i.e python lambda function. What are the syntax of python lambda or anonymous function. Where and How to use python anonymous/lambda function. What is Lambda or Anonymous function in python? The python function which is defined without name is knows as Lambda or Anonymous function. Lambda function is not declared in standard manner like other python function types. Like, While defining a normal python function we use def keyword. Whereas for defining a

Read More

Python recursive function

What is recursive function in python? Recursion is a way of programming in which a function calls itself for one or more times. A Python function which is defined to call itself during its execution is known as python recursive function. This way of programming enables the function to be executed several times. Recursive function body also contains a base condition to prevent the function getting into an infinite loop. So that was the definition of python recursive function, Now let’s proceed to understand each term in

Read More

function arguments in python

Introduction to function arguments in python: In python, Inputs given to the function are known as function arguments or parameters. Depending upon how we have defined the function, There are four basic types of arguments and in this article we are going to learn each the argument type in detail. If you don’t know the terms python function, argument, return statement etc. then I would request you to please go through the earlier article Python Functions. Python user defined function: To start with this article, Let’s

Read More

Functions in python

Introduction to python functions: In this article, We are going to learn what is python function? Different types of python functions. How to write and call python function in a program. So let’s get started with the definition of python function. What is python function? Function in python is a collection of related statements which are used to perform a specific task and return the result or value to the caller of the function. It basically breaks our code into smaller and modular chunks of code and

Read More