Lists and Tuples in Python

Lists and Tuples in Python

Assessment

Flashcard

Other

KG

Practice Problem

Hard

Created by

Wayground Content

FREE Resource

Student preview

quiz-placeholder

9 questions

Show all answers

1.

FLASHCARD QUESTION

Front

Which of the following is a valid way to create a list in Python? Options: my_list = [1, 2, 3], my_list = (1, 2, 3), my_list = {1, 2, 3}, my_list = 1, 2, 3

Back

my_list = [1, 2, 3]

2.

FLASHCARD QUESTION

Front

What is the main difference between lists and tuples?

Back

Lists are mutable, tuples are immutable

3.

FLASHCARD QUESTION

Front

How can you access the second element of a tuple t = (10, 20, 30)?

Back

t[1]

4.

FLASHCARD QUESTION

Front

Which of these methods can you use with lists but not tuples? append(), count(), index(), sort()

Back

append()

5.

FLASHCARD QUESTION

Front

Tuples can contain duplicate elements.

Back

True

6.

FLASHCARD QUESTION

Front

You can add elements to a tuple after it has been created.

Back

False

7.

FLASHCARD QUESTION

Front

A tuple is defined using __________ parentheses, while a list is defined using __________ parentheses.

Back

round, square

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?