Subroutines - Application Questions

Subroutines - Application Questions

9th - 10th Grade

14 Qs

quiz-placeholder

Similar activities

Python: Functions and Parameters

Python: Functions and Parameters

9th - 12th Grade

10 Qs

J277 - 2.2 - Functions in Python

J277 - 2.2 - Functions in Python

10th Grade - University

10 Qs

Python revision

Python revision

10th Grade - University

15 Qs

10 ԹԳՀԳ 2-րդ կիսամյակ ամփոփիչ գրավոր աշխատանք/ֆունկցիաներ/

10 ԹԳՀԳ 2-րդ կիսամյակ ամփոփիչ գրավոր աշխատանք/ֆունկցիաներ/

10th Grade

10 Qs

Programming year 9

Programming year 9

9th - 12th Grade

16 Qs

Python Quiz - 4

Python Quiz - 4

4th - 11th Grade

10 Qs

Subprograms

Subprograms

10th Grade

15 Qs

Python (Selection)

Python (Selection)

8th - 10th Grade

13 Qs

Subroutines - Application Questions

Subroutines - Application Questions

Assessment

Quiz

Computers

9th - 10th Grade

Easy

Created by

Mark Jones

Used 2+ times

FREE Resource

14 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What will be the output of this function call?

7
12
34
None

Answer explanation

3 multiplied by 4 is 12, and the function returns this value.

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What is output of this code?

Hello
Alice
Hello Alice

Hello name

Answer explanation

The print statement combines 'Hello' with the name 'Alice'.

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

Which variable is local to the function?

calculateTotal
tax
price
return

Answer explanation

tax is declared inside the function and exists only there.

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

How many arguments are passed into the subroutine ?

0
1
2
3

Answer explanation

Two parameters mean two arguments must be passed in the call.

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What will the code output?

10
25
5
2x

Answer explanation

The function multiplies 5 by 2 and returns 10.

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of using parameters in subroutines?
To store data permanently
To allow the subroutine to access user input
To pass values into the subroutine so it can use them
To speed up the program

Answer explanation

Parameters allow data to be passed into subroutines when called.

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which line shows a function call with arguments?
def add(a, b):
print('Hello')
add(3, 5)
return a + b

Answer explanation

The function call 'add(3, 5)' passes two arguments to the function.

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?