Program to get the addition with the return statement

In this python function program, we will create a function to get the addition with the return statement.

What is Function?
It is a block of code that executes when it is called.
To create a function use def keyword.

Steps to solve the program
  1. Create a function add.
  2. Use the def keyword to define the function.
  3. Pass two parameter i.e. numbers.
  4. Get the addition of the numbers using ” + ” operator.
  5. Return the total.
  6. Pass the numbers to the function while calling the function.
				
					def add(a,b):
    total = a+b
    return total
add(5,15)
				
			

Output :

				
					20
				
			

Related Articles

print and accept login credentials.

create a Fruitshop Management system.

Leave a Comment