What to use: parameters/arguments or variables?

#Variables:
Variables are used to label and store data in memory. so our programs can be understood more clearly by the reader and ourselves. It is helpful to think of variables as containers that hold information.This data can then be used throughout your program.
example:

#code
variable_name = 123#value/data
#code

#Parameter:
A parameter is a special kind of variable in computer programming language that is used to pass information between methods/procedures or class. The actual information passed is called an argument.

example:
#code
def methodname(parameter):
param = parameter
methodname("this is parameter")
#code

#What to use: parameters or variables?
There is a clear difference between variables and parameters. A variable represents a model state, and may change during simulation. A parameter is commonly used to describe objects statically. A parameter is normally a constant in a single simulation, and is changed only when you need to adjust your model behavior.

Use a variable instead of a parameter if you need to model some data unit continuously changing over time. Use a parameter instead of a variable if you just need to model some parameter of an object changed only at particular moments of time.

Comments