to pass parameters into the function. # assume w = and h = def area(w,h): return w * h print (area ( , )) Example: . The above code assigns the width and height values to the parameters w and h . These parameters are used in the creation of the function “area”.
When you call the above function, it returns the product of width and height as output. The value of and are passed to w and h respectively, the function will return as output. We often use the terms parameters and arguments interchangeably. However, there is a slight difference between them.
Parameters are the variables used in the function definition whereas arguments are the values we pass to the function parameters Function Arguments . Arguments are used to call a function and there are primarily types of functions that one can use: Required arguments, Keyword arguments, Default arguments and Variable-length arguments. 12th Computer Chapter - - Python Functions Function Arguments