DEV Community 👩‍💻👨‍💻

Cover image for Difference between arguments and parameters
Benjamin Thorpe
Benjamin Thorpe

Posted on • Updated on

Difference between arguments and parameters

Hi all.
Most people use arguments and parameters interchangeably.
But technically they are not the same.

What are arguments?

In simple words:

  • arguments are data/values that are passed to a function when you call it.
# define the function
def add(a, b):
    ...add the values

# call the function
add(2, 4)

# 2 and 4 are the arguments.
# they are the values the function will manipulate.
Enter fullscreen mode Exit fullscreen mode

What are parameters?

In simple words:

  • parameters are dummy names you pass/give a function when you are defining it.
# Example in python
def add(a, b):
    ...add the values

# a and b are the parameters for the function
# they just acts as a placeholder.
Enter fullscreen mode Exit fullscreen mode

Conclusion

If I might have missed anything, please leave a comment and help me learn from you.
Thanks for reading!!

Top comments (2)

Collapse
 
amineamami profile image
amineamami • Edited on

Thank you for the infos !

Take a look at this:

Settings

Go to your customization settings to nudge your home feed to show content more relevant to your developer experience level. 🛠