Ad Code

Responsive Advertisement

What are Formal and Actual Parameters in Python

What are Formal and Actual Parameters in Python 

Today we will learn what is the difference between Formal and Actual arguments in Python, What are Function Arguments .

What you will learn in this tutorial?


  • What is the difference between Arguments and Parameters?

  • Formal VS Actual arguments


What is the difference between Arguments and Parameters?


Parameters-:


Parameters are the variables which are defined in the Function definition.



For example-:

def add( x , y ):  // here x and y are parameters
    a = x + y
    return(a)
x = add ( 3 , 4 )  
print(x)


Arguments-:



Arguments are the values that are passed into the function during function calling.



for example -:

def add( x , y ):
    a = x + y
    return(a)
x = add ( 3 , 4 )  // here 3 and 4 are arguments
print(x)

What is the Difference between Formal and Actual Arguments?


Formal Arguments-:


Formal Arguments are also called Parameters as they are defined in the Function Definition.



For example-:

def add( m , n ): // here m and n are Formal Arguments
    a = x + y
    return(a)
x = add ( 3 , 4 )
print(x)

Actual Arguments-:


Actual Arguments are the arguments which are written inside function calling.



For example-: 

def add( x , y ):
    a = x + y
    return(a)
x = add ( 3 , 4 )
print(x)


Contact us If you have any Problem