Python Functions and Procedures Quiz

Python Functions and Procedures Quiz

9th - 11th Grade

10 Qs

quiz-placeholder

Similar activities

TLE Q3 QUIZ MODULES 1-5

TLE Q3 QUIZ MODULES 1-5

10th Grade

10 Qs

Test on Python Function

Test on Python Function

11th - 12th Grade

12 Qs

LabSim DIT Quiz 8.4.8

LabSim DIT Quiz 8.4.8

9th Grade

10 Qs

Understanding Python Functions

Understanding Python Functions

11th Grade

15 Qs

Hangman Game - Programming Questions

Hangman Game - Programming Questions

7th - 11th Grade

15 Qs

p5.js Week1 PREtest

p5.js Week1 PREtest

7th - 12th Grade

14 Qs

CMU CS Academy Unit 7.2 Local Variables

CMU CS Academy Unit 7.2 Local Variables

9th Grade

7 Qs

PC4.8-PC4.9 CSC403 T2

PC4.8-PC4.9 CSC403 T2

9th Grade

10 Qs

Python Functions and Procedures Quiz

Python Functions and Procedures Quiz

Assessment

Quiz

Computers

9th - 11th Grade

Hard

Created by

Helen Laleendra

Used 1+ times

FREE Resource

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What keyword is used to define a function in Python?

define

func

def

function

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of the 'return' statement in a function?

To return a value to the main program

To exit the function

To define a variable

To print a value

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will the function 'add_numbers(2, 2)' return?

2

4

None

22

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the procedure 'count' defined as 'for x in range(1, 11): print(x)'?

1 to 11

0 to 11

1 to 10

0 to 10

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which module is used to generate random numbers in Python?

sys

math

OS

random

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the 'randint' function from the 'random' module do?

Generates a random string

Generates a random boolean

Generates a random float

Generates a random integer

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What are the values passed to a function called?

Parameters

Arguments

Variables

Constants

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?