Skip to main content

Command Palette

Search for a command to run...

ARGUMENTS AND PARAMETER

Published
•2 min read•View as Markdown
ARGUMENTS AND PARAMETER

A number of people find it hard to differentiate between a parameter and an argument. In this blog, I will be explaining the different between these words they are often interchanged and how they are related. Let us start with arguments, argument is a value, it is what is passed as input when a function is invocated. For instance: Function declaration block def printName(name) : if len(name) < 3: print(name , " is too short") else: print(name, " is good")

Function Invocation printName(Adebayo)

Adebayo is passed as a value for name, Adebayo is an argument for the slot "name"

To parameter, parameter is the placeholder, and it is the variable used in function declaration. It is the handle that allows the codes to access the argument. In the example above, name is the parameter and Adebayo is the argument.

Thank you.

A

I would appreciate comments and critics that explains further