FBISE, NCP & NBF-aligned resources for Classes 9–12
Browse by Class
Browse by Type
Computer Chapter 3 : Topic 6.7
Function Parameters and Arguments
1 / 15
Which statement correctly identifies the arguments in the following code? $\mathbf{def\ multiply}\left( \mathbf{x,\ y} \right)\mathbf{:}$ $\mathbf{return\ x*y}$ $\mathbf{multiply(6,\ 4)}$
Reasoning: Arguments are the actual values supplied when calling a function.
2 / 15
Which option correctly identifies the relationship between parameters and arguments? $\mathbf{def\ average(a,\ b):}$ $\mathbf{return\ (a\ + \ b)\ /\ 2}$ $\mathbf{average(20,\ 40)}$
Reasoning: Parameters appear in the function definition, whereas arguments are supplied during the function call.
3 / 15
Which pair of identifiers represents the parameters in the following code? $\mathbf{def\ add(first,\ second):}$ $\mathbf{return\ first + second}$ $\mathbf{add(15,\ 10)}$
Reasoning: Parameters receive values from the arguments during function execution.
4 / 15
A function accepts three values to calculate the volume of a cuboid. How many arguments are passed when the function is called? $\mathbf{def\ volume(length,\ width,\ height):}$ $\mathbf{return\ length*width*height}$ $\mathbf{volume(5,\ 4,\ 3)}$
Reasoning: Three values $\mathbf{(}\mathbf{5}\mathbf{,\ }\mathbf{4}\mathbf{,\ }\mathbf{3}\mathbf{)}$ are passed, so there are three arguments.
5 / 15
Which statement correctly describes the function parameters? $\mathbf{def\ greeting():}$ $\mathbf{print("Welcome")}$
Reasoning: Empty parentheses indicate that the function has no parameters.
6 / 15
Which of the following values are considered the arguments? $\mathbf{def\ maximum}\left( \mathbf{a,\ b} \right)\mathbf{:}$ $\mathbf{return\ max(a,\ b)}$ $\mathbf{maximum(18,\ 25)}$
Reasoning: Arguments are the actual values supplied to the function.
7 / 15
Which option correctly identifies all parameters? $\mathbf{def\ interest(principal,\ rate,\ time):}$ $\mathbf{return\ (principal*rate*time)\ /\ 100}$
Reasoning: Parameters are listed inside the parentheses of the function definition.
8 / 15
Which statement best explains why the same function can produce different results? $\mathbf{def\ cube(n):}$ $\mathbf{r}\mathbf{eturn\ n**3}$ $\mathbf{cube(2)}$ $\mathbf{cube(5)}$
Reasoning: Different arguments assigned to the same parameter produce different results.
9 / 15
Study the Python code below and identify the parameter used in the function definition. $\mathbf{def\ greet(name):}$ $\mathbf{print("Hello",\ name)}$ $\mathbf{greet("Ali")}$
Reasoning: $\mathbf{name}$ is written in the function definition, so it is the parameter.
10 / 15
Examine the following Python code and identify the argument passed when the function is called. $\mathbf{def\ square(number):}$ $\mathbf{return\ number*number}$ $\mathbf{square(5)}$
Reasoning: $\mathbf{5}$ is supplied when the function is called, so it is the argument.
11 / 15
Which option correctly identifies both parameters and arguments from the following Python function code? $\mathbf{def\ add(x,\ y):}$ $\mathbf{return\ x + y}$ $\mathbf{add(4,\ 7)}$
Reasoning: $\mathbf{x}$ and $\mathbf{y}$ are parameters, while $\mathbf{4}$ and $\mathbf{7}$ are arguments passed to them.
12 / 15
Analyze this Python program and select the option correctly identifying its parameter and argument. $\mathbf{def\ display(city):}$ $\mathbf{print(city)}$ $\mathbf{place = "Lahore"}$ $\mathbf{display(place)}$
Reasoning: $\mathbf{city}$ is the parameter in the definition, while $\mathbf{place}$ is passed as the argument.
13 / 15
From the code below, which option correctly matches three parameters with their corresponding arguments? $\mathbf{def\ student(name,\ age,\ grade):}$ $\mathbf{print(name,\ age,\ grade)}$ $\mathbf{student("Sara",\ 16,\ 11)}$
Reasoning: Parameters appear in the function definition, while arguments are values supplied during the function call.
14 / 15
Identify the parameter receiving the second argument in the following Python function call correctly. $\mathbf{def\ calculate(length,\ width):}$ $\mathbf{return\ length*width}$ $\mathbf{calculate(8,\ 3)}$
Reasoning: Arguments match parameters by position, so $\mathbf{3}$ is passed to the second parameter $\mathbf{width}$.
15 / 15
Examine the function below and determine which option correctly distinguishes parameters from variable arguments. $\mathbf{def\ total(a,\ b):}$ $\mathbf{return\ a + b}$ $\mathbf{x = 10}$ $\mathbf{y = 20}$ $\mathbf{total(x,\ y)}$
Reasoning: $\mathbf{a}$ and $\mathbf{b}$ are parameters, while variables $\mathbf{x}$ and $\mathbf{y}$ are passed as arguments.
Your score is
Restart quiz