Chapter 9 Tuples, Lists, & Dictionaries

Chapter 9 Tuples, Lists, & Dictionaries

10 Qs

quiz-placeholder

Similar activities

Heredity CFA 1 (Week 11)

Heredity CFA 1 (Week 11)

KG - University

10 Qs

Week 10 Vocabulary Quiz

Week 10 Vocabulary Quiz

5th Grade

11 Qs

6th Grade Unit 2 Lesson 01 Quiz

6th Grade Unit 2 Lesson 01 Quiz

KG - University

15 Qs

 ELEMENTS OF ART TEST :

ELEMENTS OF ART TEST :

KG - University

15 Qs

Figurative Language Quiz

Figurative Language Quiz

6th Grade

10 Qs

[Weintek] iP Series Test 2024

[Weintek] iP Series Test 2024

KG - University

10 Qs

1st semester

1st semester

KG - University

14 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

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

By signing up, you agree to our Terms of Service & Privacy Policy

Already have an account?