Form III - Python Functions and Data Structures Quiz

Form III - Python Functions and Data Structures Quiz

12th Grade

10 Qs

quiz-placeholder

Similar activities

python String and comment

python String and comment

3rd Grade - University

13 Qs

Scope of Variables in Python

Scope of Variables in Python

1st Grade - Professional Development

15 Qs

CodeTigers Python 101

CodeTigers Python 101

KG - Professional Development

10 Qs

Comparing Python, Java, and JavaScript

Comparing Python, Java, and JavaScript

9th Grade - University

15 Qs

Python Conditionals and If Statements

Python Conditionals and If Statements

8th Grade - University

15 Qs

CO - 1 Quiz - 1-DB_Python Basic

CO - 1 Quiz - 1-DB_Python Basic

10th Grade - University

15 Qs

Google Drawing

Google Drawing

9th - 12th Grade

12 Qs

Python Basics

Python Basics

KG - University

15 Qs

Form III - Python Functions and Data Structures Quiz

Form III - Python Functions and Data Structures Quiz

Assessment

Quiz

Computers

12th Grade

Hard

Created by

Kiers Mcfarlane

FREE Resource

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is an advantage of using functions in Python?
Criterion 1: Evaluate and select information sources based on their appropriateness to specific tasks

They make code longer.

They allow you to reuse code efficiently.

They make the code harder to debug.

They increase the risk of errors in the program.

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the return statement do in a Python function?
Criterion 2: Apply reasoning to solve real-world problems in various contexts

It sends a result back to the function.

It loops through the function.

`return` terminates the function and sends a result back.

It skips the function.

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following would correctly add an item to a list in Python?
Criterion 2: Apply reasoning to solve real-world problems in various contexts

friends.add("Diana")

friends.append("Diana")

friends.insert("Diana")

friends.update("Diana")

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which statement is true about Python dictionaries?
Criterion 1: Evaluate and select information sources based on their appropriateness to specific tasks

They store items in a specific order.

They store key-value pairs.

They can only store strings as values.

They cannot be changed once created.

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What happens if you try to access a key that doesn’t exist in a Python dictionary?
Criterion 2: Apply reasoning to solve real-world problems in various contexts

The program crashes.

`KeyError` is raised.

It returns an empty string.

It returns `None`.

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which block of code correctly handles an exception when a user inputs a non-integer value?
Criterion 1: Evaluate and select information sources based on their appropriateness to specific tasks

Media Image
Media Image
Media Image
Media Image

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is most suitable for storing and accessing information about a student's name, age, and subjects?
Criterion 1: Evaluate and select information sources based on their appropriateness to specific tasks

Media Image
Media Image
Media Image
Media Image

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?