An Interest In:
Web News this Week
- May 1, 2024
- April 30, 2024
- April 29, 2024
- April 28, 2024
- April 27, 2024
- April 26, 2024
- April 25, 2024
May 5, 2021 07:34 pm GMT
Original Link: https://dev.to/benjithorpe/difference-between-arguments-and-parameters-58gm
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 them.
# define the functiondef add(a, b): ...add the values# call the functionadd(2, 4)# 2 and 4 are the arguments.# they are the values the function will manipulate.
What are parameters
In simple words:
- parameters are dummy names you pass/give a function when you are defining it.
# Example in pythondef add(a, b): ...add the values# a and b are the parameters for the function# they just acts as a placeholder.
Conclusion
If I might have missed anything, please leave a comment and help me learn from you.
Thanks for reading!!
Original Link: https://dev.to/benjithorpe/difference-between-arguments-and-parameters-58gm
Share this article:
Tweet
View Full Article
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To