Q. Differentiate between following with the help of an example:
(a) Argument and Parameter
(b) Global and Local variable
Answer:-
(a)
Argument: - A value provided to a function in the function call statement.
Parameter: - A name used inside a function to refer to the value which was passed to it as an argument.
For example: -
def addEm(x, y, z):
print(x + y + z)
addEm(6, 16, 26)
• In the above code, arguments are 6, 16 and 26; and parameter are x, y and z.
(b)
https://www.pathwalla.com/2020/09/what-is-difference-between-local.html?m=1
Post a Comment
You can help us by Clicking on ads. ^_^
Please do not send spam comment : )