Chapter 9 Tuples, Lists, & Dictionaries

Chapter 9 Tuples, Lists, & Dictionaries

10 Qs

quiz-placeholder

Similar activities

Listing Fun!

Listing Fun!

KG - University

10 Qs

Feudalism in Medieval Europe

Feudalism in Medieval Europe

KG - University

10 Qs

Animal Trait Test Review

Animal Trait Test Review

3rd Grade

10 Qs

Ch.9 - Preparing the Environment -  modified

Ch.9 - Preparing the Environment - modified

KG - University

12 Qs

Light Task Cards 1-10

Light Task Cards 1-10

KG - University

11 Qs

Ch.9 Post-test

Ch.9 Post-test

KG - University

15 Qs

Python Variables, Data Types, Loops, Operators, Lists, Sets, Dictionary, Tuples, and If-Else Quiz

Python Variables, Data Types, Loops, Operators, Lists, Sets, Dictionary, Tuples, and If-Else Quiz

12th Grade

10 Qs

Chapter 9 Tuples, Lists, & Dictionaries

Chapter 9 Tuples, Lists, & Dictionaries

Assessment

Quiz

others

Medium

Created by

Dottie Holland

Used 7+ times

FREE Resource

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.

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?