Search Header Logo

Data Structure

Authored by yeshi dema

Computers

10th Grade

Used 7+ times

Data Structure
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following statements about Python lists is true?

Lists are immutable.

Lists are ordered collections.

Lists can only contain elements of the same data type.

Lists use curly braces {} for initialization.

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the correct way to add an element 'x' to the end of a list my_list?

'my_list.add(x)'

'my_list.insert(x, -1)'

'my_list.extend(x)'

'my_list.append(x)'

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following statements is true about tuples in Python?

Tuples are mutable.

Tuples are unordered.

Tuples can be used as keys in dictionaries.

Tuples use square brackets [] for initialization.

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the primary difference between a list and a tuple in Python?

Lists are ordered, and tuples are unordered.

Lists are mutable, and tuples are immutable.

Lists can store elements of different data types, while tuples cannot.

Lists have a fixed size, while tuples can grow dynamically.

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following statements about Python sets is true?

Sets allow duplicate elements.

Sets are ordered collections.

Sets are represented using square brackets [].

Sets automatically sort their elements.

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What is the result of the following set operation in Python?

'intersection' will be an empty set.

'intersection' will contain the elements {1, 2, 3, 4, 5}.

'intersection' will contain the element {3}.

The code will raise an error.

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In a Python dictionary, what is the purpose of a key?

Keys are used to access values.

Keys are used to store duplicate values.

Keys are not necessary in dictionaries.

Keys determine the order of elements.

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?