Chapter 9 Tuples, Lists, & Dictionaries

Chapter 9 Tuples, Lists, & Dictionaries

10 Qs

quiz-placeholder

Similar activities

Lesson 31 Quiz: The Legacy of Ancient Greece

Lesson 31 Quiz: The Legacy of Ancient Greece

KG - University

15 Qs

Studies Weekly Vocabulary Quiz: 1

Studies Weekly Vocabulary Quiz: 1

KG - University

12 Qs

Worm and Caterpillar are Friends by Kaz Windness

Worm and Caterpillar are Friends by Kaz Windness

1st - 5th Grade

10 Qs

6.3 Question Bank:  La piñata

6.3 Question Bank: La piñata

KG - University

11 Qs

Digital Art Assessment

Digital Art Assessment

KG - University

12 Qs

7th grade Interior Design

7th grade Interior Design

7th Grade

12 Qs

Chapter 9 Tuples, Lists, & Dictionaries

Chapter 9 Tuples, Lists, & Dictionaries

Assessment

Quiz

others

Practice Problem

Medium

Created by

Dottie Holland

Used 7+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 10 pts

colors = ["red", "green", "burnt sienna", "blue"] colors[2] What is the output of the colors[2] expression?

It causes a run-time error.
'blue'
'red'
'green'
'burnt sienna'

2.

FILL IN THE BLANK QUESTION

30 sec • 10 pts

colors = ["red", "green", "burnt sienna", "blue"] Select the value 'red' from the above list?

3.

MULTIPLE CHOICE QUESTION

30 sec • 10 pts

colors = ["red", "green", "burnt sienna", "blue"] "yellow" in colors What is the result of the yellow in colors expression?

3
4
ValueError: 'yellow' is not in list
False

4.

FILL IN THE BLANK QUESTION

30 sec • 10 pts

Consider the following nested list definition:

x = [10, [3.141, 20, [30, 'baz', 2.718]], 'foo']

What is the expression that returns the 'z' in 'baz'?

5.

MULTIPLE CHOICE QUESTION

30 sec • 10 pts

What’s the main difference between Python lists and tuples?

Lists are faster and tuples are slower.
Lists are mutable and tuples are immutable.
Lists can hold any data type and tuples can only contain int and str objects.
Lists are immutable and tuples are mutable.

6.

MULTIPLE CHOICE QUESTION

30 sec • 10 pts

How do you assign a tuple of length 1 to the variable a?

a = [1]
a = 1
a = tuple(1)
a = (1,)

7.

MULTIPLE SELECT QUESTION

30 sec • 10 pts

Which of the following are true of Python dictionaries:

Dictionaries are accessed by key.
Dictionaries can be nested to any depth.
Dictionaries are mutable.
Items are accessed by their position in a dictionary.
All the keys in a dictionary must be of the same type.

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?