### Python function to check whether a number is perfect or not

Method 1: Using for loop Output: Explanation: This first method is to use a for loop to iterate through all the divisors of the number…

### Python | Find LCM using function

Let us take a look t methods that we have to find the LCM using functions Method 1: Using the divide operator Output: Explanation: Here…

### Python | Find HCF using function

Let us take a look at all the different methods that we have to find the HCF using Python functions Method 1: Using for loop…

### Python | Convert the binary number to decimal without using library function

In this article, we will be covering all the methods that we have to solve the given problem Method 1: Using a while loop Output:…

### Python | Create a basic operations calculator(+, -, /, and x), create a separate function for each operation

Let us take a look at an approach to solving this problem statement. Explanation: Here in this part, we have defined various functions to handle…

### Python | Detecting the number of local variables declared in a function

To calculate the number of local variables in a particular function we have a dedicated built-in function. Let us take a look at it Output:…

### Python | Making a chain of function decorators (bold italic underline etc)

Output: Explanation: Here in this program, we defined three functions and in each function, we added the tags for bold, italic and underline respectively. A…

### Python | Access function inside a function

Let us take a look at how this can be done in Python. Example 1: Explanation: We define inner functions—also referred to as nested functions—within…

### Event Management System Project in Python

In this article, we will create Event Management System Project in Python with source code. Using this event management system, one can easily maintain ticket…

### ATM machine program in C++

In this article, we will build an ATM machine program in C++ that will have all the basic functionalities of an ATM. This project is…

### Python | Create a function with a pass statement

Today, in this article we will be learning about a Python Program to create a function with a pass statement. Before moving on to the…

### Python | Function to calculate the square root of a number

Let us look at the methods we have to calculate the square root of a number. Here we will use functions. In the first method,…

### Python | A function that calculates the power of a number

Let us take a look at how to code for this program. We have some built-in functions and other than that we will also take…

### Python | A function that accepts 2 integers and adds them and returns their sum

Here we will go through two methods that are there to solve this problem. Let us take a look at each of them. Method 1:…

### Python | Function that takes a list of integers and returns the last integer

Let us now take a look at the different ways in which we can solve this problem. Here we will be using the concept of…

### Python | Return multiple values from a function

Explanation: Once we defined the function and if we want to return multiple values then we simply use the return keyword along with the values…

### Python function that takes a list and returns a new list with unique elements of the first list

Let us get our hands on the Python list with the more amazing problem to solve. Method 1: Using a new list and “not in”…

### Python | Generate a random number in the range of 1 to 10 using the function

Method 1: Using randint() from NumPy Output: Explanation: In this method, we used the numpy library. We defined two variables start and end and passed…

### Python | Check Whether a Given Number is Even or Odd using Recursion

Let us go through all the methods using which we can solve this problem of finding odd and even numbers Method 1: Using the number…

### Python | Print Binary Equivalent of an Integer using Recursion

In order to solve this problem, we only have one method to use. Let us take a look at it. Output: Explanation: Here we used…